Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_18.ADF » S/M/PREVIEWER/PrevSrc

S/M/PREVIEWER/PrevSrc

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_18.ADF
Filename: S/M/PREVIEWER/PrevSrc
Read OK:
File size: 074B bytes
Load address: FFFF0E00
Exec address: FFFF802B
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10PROCassemble
   20name$="Preview"
   30OSCLI("SAVE "+name$+" "+STR$~start+" "+STR$~P%)
   40END
   50:
   60DEFPROCassemble
   70osfind=&FFCE
   80osargs=&FFDA
   90osbget=&FFD7
  100xsize=&A8
  110ysize=&AA
  120addr=&AC
  130scraddr=&AE
  140start=&900
  150FOR pass=0 TO 3 STEP 3
  160P%=start
  170[OPT pass
  180LDA #1
  190LDX #addr
  200LDY #0
  210JSR osargs
  220LDY #0
  230LDA (addr),Y
  240CMP #13
  250BNE syntaxok
  260BRK
  270EQUB (16)
  280EQUS ("Preview <fname>")
  290BRK
  300.syntaxok
  310LDA &355
  320BEQ modeok
  330BRK
  340EQUB (25)
  350EQUS ("Needs Mode 0")
  360BRK
  370.modeok
  380LDX addr
  390LDY addr+1
  400LDA #&40
  410JSR osfind
  420STA channel
  430TAY
  440JSR osbget
  450STA xsize
  460JSR osbget
  470STA xsize+1
  480JSR osbget
  490STA ysize
  500JSR osbget
  510STA ysize+1
  520LSR xsize+1
  530ROR xsize
  540LSR xsize+1
  550ROR xsize
  560LSR xsize+1
  570ROR xsize
  580LSR xsize+1
  590ROR xsize
  600LSR ysize+1
  610ROR ysize
  620LSR ysize+1
  630ROR ysize
  640LDA #&30
  650STA addr+1
  660LDA #0
  670STA addr
  680.mainloop
  690LDA addr
  700STA scraddr
  710LDA addr+1
  720STA scraddr+1
  730LDA ysize
  740STA newy
  750LDA ysize+1
  760STA newy+1
  770.writetoscr
  780LDY channel
  790JSR osbget
  800LDY #0
  810STA (scraddr),Y
  820LDA newy
  830SEC
  840SBC #1
  850STA newy
  860BCS carryset
  870DEC newy+1
  880.carryset
  890LDA scraddr
  900AND #7
  910CMP #7
  920BNE notseven
  930LDA scraddr
  940CLC
  950ADC #633 MOD 256
  960STA scraddr
  970LDA scraddr+1
  980ADC #633 DIV 256
  990STA scraddr+1
 1000JMP nextbyte
 1010.notseven
 1020LDA scraddr
 1030CLC
 1040ADC #1
 1050STA scraddr
 1060BCC nextbyte
 1070INC scraddr+1
 1080.nextbyte
 1090LDA newy
 1100BNE writetoscr
 1110LDA newy+1
 1120BNE writetoscr
 1130LDA addr
 1140CLC
 1150ADC #8
 1160STA addr
 1170LDA addr+1
 1180ADC #0
 1190STA addr+1
 1200LDA xsize
 1210SEC
 1220SBC #1
 1230STA xsize
 1240BCS carryset2
 1250DEC xsize+1
 1260.carryset2
 1270LDA xsize
 1280BNE mainloop
 1290LDA xsize+1
 1300BNE mainloop
 1310LDY channel
 1320LDA #0
 1330JMP osfind
 1340.channel
 1350EQUB (0)
 1360.newy
 1370EQUW (0)
 1380]
 1390NEXT
 1400ENDPROC


�assemble
name$="Preview"
)�("SAVE "+name$+" "+�~start+" "+�~P%)
(�
2:
<��assemble
Fosfind=&FFCE
Posargs=&FFDA
Zosbget=&FFD7
d
xsize=&A8
n
ysize=&AA
xaddr=&AC
�scraddr=&AE
�start=&900
�� pass=0 � 3 � 3
�P%=start
�
[OPT pass
�
LDA #1
�
LDX #addr
�
LDY #0
�JSR osargs
�
LDY #0
�LDA (addr),Y
�CMP #13
�BNE syntaxok
BRK

EQUB (16)
EQUS ("Preview <fname>")
"BRK
,
.syntaxok
6LDA &355
@BEQ modeok
JBRK
T
EQUB (25)
^EQUS ("Needs Mode 0")
hBRK
r.modeok
|LDX addr
�LDY addr+1
�LDA #&40
�JSR osfind
�STA channel
�TAY
�JSR osbget
�
STA xsize
�JSR osbget
�STA xsize+1
�JSR osbget
�
STA ysize
�JSR osbget
�STA ysize+1
LSR xsize+1

ROR xsize
LSR xsize+1
&
ROR xsize
0LSR xsize+1
:
ROR xsize
DLSR xsize+1
N
ROR xsize
XLSR ysize+1
b
ROR ysize
lLSR ysize+1
v
ROR ysize
�LDA #&30
�STA addr+1
�
LDA #0
�STA addr
�
.mainloop
�LDA addr
�STA scraddr
�LDA addr+1
�STA scraddr+1
�
LDA ysize
�STA newy
�LDA ysize+1
�STA newy+1
.writetoscr
LDY channel
JSR osbget
 
LDY #0
*STA (scraddr),Y
4LDA newy
>SEC
H
SBC #1
RSTA newy
\BCS carryset
fDEC newy+1
p
.carryset
zLDA scraddr
�� #7
�
CMP #7
�BNE notseven
�LDA scraddr
�CLC
�ADC #633 � 256
�STA scraddr
�LDA scraddr+1
�ADC #633 � 256
�STA scraddr+1
�JMP nextbyte
�
.notseven
�LDA scraddr
CLC

ADC #1
STA scraddr
$BCC nextbyte
.INC scraddr+1
8
.nextbyte
BLDA newy
LBNE writetoscr
VLDA newy+1
`BNE writetoscr
jLDA addr
tCLC
~
ADC #8
�STA addr
�LDA addr+1
�
ADC #0
�STA addr+1
�
LDA xsize
�SEC
�
SBC #1
�
STA xsize
�BCS carryset2
�DEC xsize+1
�.carryset2
�
LDA xsize
BNE mainloop

LDA xsize+1
BNE mainloop
LDY channel
(
LDA #0
2JMP osfind
<.channel
FEQUB (0)
P	.newy
ZEQUW (0)
d]
n�
x�
�
00000000  0d 00 0a 0d f2 61 73 73  65 6d 62 6c 65 0d 00 14  |.....assemble...|
00000010  13 6e 61 6d 65 24 3d 22  50 72 65 76 69 65 77 22  |.name$="Preview"|
00000020  0d 00 1e 29 ff 28 22 53  41 56 45 20 22 2b 6e 61  |...).("SAVE "+na|
00000030  6d 65 24 2b 22 20 22 2b  c3 7e 73 74 61 72 74 2b  |me$+" "+.~start+|
00000040  22 20 22 2b c3 7e 50 25  29 0d 00 28 05 e0 0d 00  |" "+.~P%)..(....|
00000050  32 05 3a 0d 00 3c 0e dd  f2 61 73 73 65 6d 62 6c  |2.:..<...assembl|
00000060  65 0d 00 46 10 6f 73 66  69 6e 64 3d 26 46 46 43  |e..F.osfind=&FFC|
00000070  45 0d 00 50 10 6f 73 61  72 67 73 3d 26 46 46 44  |E..P.osargs=&FFD|
00000080  41 0d 00 5a 10 6f 73 62  67 65 74 3d 26 46 46 44  |A..Z.osbget=&FFD|
00000090  37 0d 00 64 0d 78 73 69  7a 65 3d 26 41 38 0d 00  |7..d.xsize=&A8..|
000000a0  6e 0d 79 73 69 7a 65 3d  26 41 41 0d 00 78 0c 61  |n.ysize=&AA..x.a|
000000b0  64 64 72 3d 26 41 43 0d  00 82 0f 73 63 72 61 64  |ddr=&AC....scrad|
000000c0  64 72 3d 26 41 45 0d 00  8c 0e 73 74 61 72 74 3d  |dr=&AE....start=|
000000d0  26 39 30 30 0d 00 96 14  e3 20 70 61 73 73 3d 30  |&900..... pass=0|
000000e0  20 b8 20 33 20 88 20 33  0d 00 a0 0c 50 25 3d 73  | . 3 . 3....P%=s|
000000f0  74 61 72 74 0d 00 aa 0d  5b 4f 50 54 20 70 61 73  |tart....[OPT pas|
00000100  73 0d 00 b4 0a 4c 44 41  20 23 31 0d 00 be 0d 4c  |s....LDA #1....L|
00000110  44 58 20 23 61 64 64 72  0d 00 c8 0a 4c 44 59 20  |DX #addr....LDY |
00000120  23 30 0d 00 d2 0e 4a 53  52 20 6f 73 61 72 67 73  |#0....JSR osargs|
00000130  0d 00 dc 0a 4c 44 59 20  23 30 0d 00 e6 10 4c 44  |....LDY #0....LD|
00000140  41 20 28 61 64 64 72 29  2c 59 0d 00 f0 0b 43 4d  |A (addr),Y....CM|
00000150  50 20 23 31 33 0d 00 fa  10 42 4e 45 20 73 79 6e  |P #13....BNE syn|
00000160  74 61 78 6f 6b 0d 01 04  07 42 52 4b 0d 01 0e 0d  |taxok....BRK....|
00000170  45 51 55 42 20 28 31 36  29 0d 01 18 1c 45 51 55  |EQUB (16)....EQU|
00000180  53 20 28 22 50 72 65 76  69 65 77 20 3c 66 6e 61  |S ("Preview <fna|
00000190  6d 65 3e 22 29 0d 01 22  07 42 52 4b 0d 01 2c 0d  |me>")..".BRK..,.|
000001a0  2e 73 79 6e 74 61 78 6f  6b 0d 01 36 0c 4c 44 41  |.syntaxok..6.LDA|
000001b0  20 26 33 35 35 0d 01 40  0e 42 45 51 20 6d 6f 64  | &355..@.BEQ mod|
000001c0  65 6f 6b 0d 01 4a 07 42  52 4b 0d 01 54 0d 45 51  |eok..J.BRK..T.EQ|
000001d0  55 42 20 28 32 35 29 0d  01 5e 19 45 51 55 53 20  |UB (25)..^.EQUS |
000001e0  28 22 4e 65 65 64 73 20  4d 6f 64 65 20 30 22 29  |("Needs Mode 0")|
000001f0  0d 01 68 07 42 52 4b 0d  01 72 0b 2e 6d 6f 64 65  |..h.BRK..r..mode|
00000200  6f 6b 0d 01 7c 0c 4c 44  58 20 61 64 64 72 0d 01  |ok..|.LDX addr..|
00000210  86 0e 4c 44 59 20 61 64  64 72 2b 31 0d 01 90 0c  |..LDY addr+1....|
00000220  4c 44 41 20 23 26 34 30  0d 01 9a 0e 4a 53 52 20  |LDA #&40....JSR |
00000230  6f 73 66 69 6e 64 0d 01  a4 0f 53 54 41 20 63 68  |osfind....STA ch|
00000240  61 6e 6e 65 6c 0d 01 ae  07 54 41 59 0d 01 b8 0e  |annel....TAY....|
00000250  4a 53 52 20 6f 73 62 67  65 74 0d 01 c2 0d 53 54  |JSR osbget....ST|
00000260  41 20 78 73 69 7a 65 0d  01 cc 0e 4a 53 52 20 6f  |A xsize....JSR o|
00000270  73 62 67 65 74 0d 01 d6  0f 53 54 41 20 78 73 69  |sbget....STA xsi|
00000280  7a 65 2b 31 0d 01 e0 0e  4a 53 52 20 6f 73 62 67  |ze+1....JSR osbg|
00000290  65 74 0d 01 ea 0d 53 54  41 20 79 73 69 7a 65 0d  |et....STA ysize.|
000002a0  01 f4 0e 4a 53 52 20 6f  73 62 67 65 74 0d 01 fe  |...JSR osbget...|
000002b0  0f 53 54 41 20 79 73 69  7a 65 2b 31 0d 02 08 0f  |.STA ysize+1....|
000002c0  4c 53 52 20 78 73 69 7a  65 2b 31 0d 02 12 0d 52  |LSR xsize+1....R|
000002d0  4f 52 20 78 73 69 7a 65  0d 02 1c 0f 4c 53 52 20  |OR xsize....LSR |
000002e0  78 73 69 7a 65 2b 31 0d  02 26 0d 52 4f 52 20 78  |xsize+1..&.ROR x|
000002f0  73 69 7a 65 0d 02 30 0f  4c 53 52 20 78 73 69 7a  |size..0.LSR xsiz|
00000300  65 2b 31 0d 02 3a 0d 52  4f 52 20 78 73 69 7a 65  |e+1..:.ROR xsize|
00000310  0d 02 44 0f 4c 53 52 20  78 73 69 7a 65 2b 31 0d  |..D.LSR xsize+1.|
00000320  02 4e 0d 52 4f 52 20 78  73 69 7a 65 0d 02 58 0f  |.N.ROR xsize..X.|
00000330  4c 53 52 20 79 73 69 7a  65 2b 31 0d 02 62 0d 52  |LSR ysize+1..b.R|
00000340  4f 52 20 79 73 69 7a 65  0d 02 6c 0f 4c 53 52 20  |OR ysize..l.LSR |
00000350  79 73 69 7a 65 2b 31 0d  02 76 0d 52 4f 52 20 79  |ysize+1..v.ROR y|
00000360  73 69 7a 65 0d 02 80 0c  4c 44 41 20 23 26 33 30  |size....LDA #&30|
00000370  0d 02 8a 0e 53 54 41 20  61 64 64 72 2b 31 0d 02  |....STA addr+1..|
00000380  94 0a 4c 44 41 20 23 30  0d 02 9e 0c 53 54 41 20  |..LDA #0....STA |
00000390  61 64 64 72 0d 02 a8 0d  2e 6d 61 69 6e 6c 6f 6f  |addr.....mainloo|
000003a0  70 0d 02 b2 0c 4c 44 41  20 61 64 64 72 0d 02 bc  |p....LDA addr...|
000003b0  0f 53 54 41 20 73 63 72  61 64 64 72 0d 02 c6 0e  |.STA scraddr....|
000003c0  4c 44 41 20 61 64 64 72  2b 31 0d 02 d0 11 53 54  |LDA addr+1....ST|
000003d0  41 20 73 63 72 61 64 64  72 2b 31 0d 02 da 0d 4c  |A scraddr+1....L|
000003e0  44 41 20 79 73 69 7a 65  0d 02 e4 0c 53 54 41 20  |DA ysize....STA |
000003f0  6e 65 77 79 0d 02 ee 0f  4c 44 41 20 79 73 69 7a  |newy....LDA ysiz|
00000400  65 2b 31 0d 02 f8 0e 53  54 41 20 6e 65 77 79 2b  |e+1....STA newy+|
00000410  31 0d 03 02 0f 2e 77 72  69 74 65 74 6f 73 63 72  |1.....writetoscr|
00000420  0d 03 0c 0f 4c 44 59 20  63 68 61 6e 6e 65 6c 0d  |....LDY channel.|
00000430  03 16 0e 4a 53 52 20 6f  73 62 67 65 74 0d 03 20  |...JSR osbget.. |
00000440  0a 4c 44 59 20 23 30 0d  03 2a 13 53 54 41 20 28  |.LDY #0..*.STA (|
00000450  73 63 72 61 64 64 72 29  2c 59 0d 03 34 0c 4c 44  |scraddr),Y..4.LD|
00000460  41 20 6e 65 77 79 0d 03  3e 07 53 45 43 0d 03 48  |A newy..>.SEC..H|
00000470  0a 53 42 43 20 23 31 0d  03 52 0c 53 54 41 20 6e  |.SBC #1..R.STA n|
00000480  65 77 79 0d 03 5c 10 42  43 53 20 63 61 72 72 79  |ewy..\.BCS carry|
00000490  73 65 74 0d 03 66 0e 44  45 43 20 6e 65 77 79 2b  |set..f.DEC newy+|
000004a0  31 0d 03 70 0d 2e 63 61  72 72 79 73 65 74 0d 03  |1..p..carryset..|
000004b0  7a 0f 4c 44 41 20 73 63  72 61 64 64 72 0d 03 84  |z.LDA scraddr...|
000004c0  08 80 20 23 37 0d 03 8e  0a 43 4d 50 20 23 37 0d  |.. #7....CMP #7.|
000004d0  03 98 10 42 4e 45 20 6e  6f 74 73 65 76 65 6e 0d  |...BNE notseven.|
000004e0  03 a2 0f 4c 44 41 20 73  63 72 61 64 64 72 0d 03  |...LDA scraddr..|
000004f0  ac 07 43 4c 43 0d 03 b6  12 41 44 43 20 23 36 33  |..CLC....ADC #63|
00000500  33 20 83 20 32 35 36 0d  03 c0 0f 53 54 41 20 73  |3 . 256....STA s|
00000510  63 72 61 64 64 72 0d 03  ca 11 4c 44 41 20 73 63  |craddr....LDA sc|
00000520  72 61 64 64 72 2b 31 0d  03 d4 12 41 44 43 20 23  |raddr+1....ADC #|
00000530  36 33 33 20 81 20 32 35  36 0d 03 de 11 53 54 41  |633 . 256....STA|
00000540  20 73 63 72 61 64 64 72  2b 31 0d 03 e8 10 4a 4d  | scraddr+1....JM|
00000550  50 20 6e 65 78 74 62 79  74 65 0d 03 f2 0d 2e 6e  |P nextbyte.....n|
00000560  6f 74 73 65 76 65 6e 0d  03 fc 0f 4c 44 41 20 73  |otseven....LDA s|
00000570  63 72 61 64 64 72 0d 04  06 07 43 4c 43 0d 04 10  |craddr....CLC...|
00000580  0a 41 44 43 20 23 31 0d  04 1a 0f 53 54 41 20 73  |.ADC #1....STA s|
00000590  63 72 61 64 64 72 0d 04  24 10 42 43 43 20 6e 65  |craddr..$.BCC ne|
000005a0  78 74 62 79 74 65 0d 04  2e 11 49 4e 43 20 73 63  |xtbyte....INC sc|
000005b0  72 61 64 64 72 2b 31 0d  04 38 0d 2e 6e 65 78 74  |raddr+1..8..next|
000005c0  62 79 74 65 0d 04 42 0c  4c 44 41 20 6e 65 77 79  |byte..B.LDA newy|
000005d0  0d 04 4c 12 42 4e 45 20  77 72 69 74 65 74 6f 73  |..L.BNE writetos|
000005e0  63 72 0d 04 56 0e 4c 44  41 20 6e 65 77 79 2b 31  |cr..V.LDA newy+1|
000005f0  0d 04 60 12 42 4e 45 20  77 72 69 74 65 74 6f 73  |..`.BNE writetos|
00000600  63 72 0d 04 6a 0c 4c 44  41 20 61 64 64 72 0d 04  |cr..j.LDA addr..|
00000610  74 07 43 4c 43 0d 04 7e  0a 41 44 43 20 23 38 0d  |t.CLC..~.ADC #8.|
00000620  04 88 0c 53 54 41 20 61  64 64 72 0d 04 92 0e 4c  |...STA addr....L|
00000630  44 41 20 61 64 64 72 2b  31 0d 04 9c 0a 41 44 43  |DA addr+1....ADC|
00000640  20 23 30 0d 04 a6 0e 53  54 41 20 61 64 64 72 2b  | #0....STA addr+|
00000650  31 0d 04 b0 0d 4c 44 41  20 78 73 69 7a 65 0d 04  |1....LDA xsize..|
00000660  ba 07 53 45 43 0d 04 c4  0a 53 42 43 20 23 31 0d  |..SEC....SBC #1.|
00000670  04 ce 0d 53 54 41 20 78  73 69 7a 65 0d 04 d8 11  |...STA xsize....|
00000680  42 43 53 20 63 61 72 72  79 73 65 74 32 0d 04 e2  |BCS carryset2...|
00000690  0f 44 45 43 20 78 73 69  7a 65 2b 31 0d 04 ec 0e  |.DEC xsize+1....|
000006a0  2e 63 61 72 72 79 73 65  74 32 0d 04 f6 0d 4c 44  |.carryset2....LD|
000006b0  41 20 78 73 69 7a 65 0d  05 00 10 42 4e 45 20 6d  |A xsize....BNE m|
000006c0  61 69 6e 6c 6f 6f 70 0d  05 0a 0f 4c 44 41 20 78  |ainloop....LDA x|
000006d0  73 69 7a 65 2b 31 0d 05  14 10 42 4e 45 20 6d 61  |size+1....BNE ma|
000006e0  69 6e 6c 6f 6f 70 0d 05  1e 0f 4c 44 59 20 63 68  |inloop....LDY ch|
000006f0  61 6e 6e 65 6c 0d 05 28  0a 4c 44 41 20 23 30 0d  |annel..(.LDA #0.|
00000700  05 32 0e 4a 4d 50 20 6f  73 66 69 6e 64 0d 05 3c  |.2.JMP osfind..<|
00000710  0c 2e 63 68 61 6e 6e 65  6c 0d 05 46 0c 45 51 55  |..channel..F.EQU|
00000720  42 20 28 30 29 0d 05 50  09 2e 6e 65 77 79 0d 05  |B (0)..P..newy..|
00000730  5a 0c 45 51 55 57 20 28  30 29 0d 05 64 05 5d 0d  |Z.EQUW (0)..d.].|
00000740  05 6e 05 ed 0d 05 78 05  e1 0d ff                 |.n....x....|
0000074b
S/M/PREVIEWER/PrevSrc.m0
S/M/PREVIEWER/PrevSrc.m1
S/M/PREVIEWER/PrevSrc.m2
S/M/PREVIEWER/PrevSrc.m4
S/M/PREVIEWER/PrevSrc.m5