Home » CEEFAX disks » telesoftware14.adl » 05-03-89/Scroll

05-03-89/Scroll

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 » CEEFAX disks » telesoftware14.adl
Filename: 05-03-89/Scroll
Read OK:
File size: 11CB bytes
Load address: FFFF0E00
Exec address: FFFF802B
File contents
   10REM> SCROLL
   20A%=&EA :REM: read Tube presence flag
   30X%=0
   40Y%=&FF
   50IF ((USR(&FFF4)AND&FF00)DIV&100)<>0 END
   60zeropage=&70 :REM: 2 byte workspace
   70wordv=&20C :REM: osword indirection vector
   80mcode=&A00 :REM: machine code at &A00
   90addreg=&FE00 :REM: 6845 internal register select register
  100intreg=&FE01 :REM: 6845 internal register data register
  110oswrch=&FFEE
  120osbyte=&FFF4
  130FOR pass=0 TO 2 STEP 2
  140P%=mcode
  150[OPT pass
  160.firstbyte
  170LDX wordv \ osword vector low byte
  180LDY wordv+1 \ osword vector high byte
  190CPY #newcode DIV 256 \ is the vector already modified?
  200BEQ return \ return if already altered
  210STX oldvector \ save the original osword vector, low byte
  220STY oldvector+1 \ and high byte
  230LDX #newcode MOD 256 \ low byte of new code
  240LDY #newcode DIV 256 \ and high byte
  250STX wordv \ alter osword vector, low byte
  260STY wordv+1 \ and high byte
  270LDA #&16 \ decimal 22
  280JSR oswrch
  290LDA #&07
  300JSR oswrch \ mode 7
  310.screenaddr
  320LDA #&0D \ decimal 13
  330STA counter \ initialise line counter
  340LDA #&A0 \ read VDU variable value
  350LDX #&50 \ offset &50 points to start of screen address
  360JSR osbyte
  370STX lsb \ X contains low byte
  380TYA \ Y contains high byte, to be modified in Mode 7
  390CLD
  400SEC
  410SBC #&74 \ by subtracting &74
  420EOR #&20 \ and EORing with #&20
  430STA msb \ Mode 7 modified high byte
  440.return
  450RTS
  460.newcode
  470CMP #&7A \ all ATS osword calls use osword &7A
  480BNE jump \ branch if not from ATS
  490STX zeropage \ X and Y point to the parameter block
  500STY zeropage+1
  510LDY #&00 \ index to point to first parameter
  520LDA (zeropage),Y \ read first parameter
  530CMP #&A0 \ &A0 = unused function key
  540BEQ unused \ branch if unused function key
  550LDA #&7A \ restore accumulator
  560LDY zeropage+1 \ restore Y
  570.jump
  580JMP (oldvector) \ exit using the original osword vector
  590.unused
  600INY
  610LDA (zeropage),Y
  620CMP #&15 \ 21 = shift+f5, ATS 2.58 unused function key
  630BEQ full \ display full screen
  640CMP #&19 \ 25 = shift+f9, ATS/ATS+ unused function key
  650BEQ down \ scroll down screen
  660.up
  670LDA lsb \ low byte of the top LH corner
  680CLD
  690SEC
  700SBC #&28 \ calculate new top LH corner of screen, low byte
  710STA lsb
  720LDA msb \ high byte of the top LH corner
  730SBC #&00 \ calculate new top LH corner of screen, high byte
  740STA msb
  750INC counter
  760BEQ up \ if on the bottom line subtract again
  770LDA counter
  780CMP #&0E \ are we on the top line?
  790BCC scroll \ scroll the picture
  800JSR screenaddr \ re-initialise screen
  810.scroll
  820JSR all \ and alter registers 12 and 13
  830LDX #&00 \ register 0, horizontal total
  840LDY #&7F \ value 127
  850JSR sheila \ VDU 23;0,127;0;0;0
  860LDX #&04 \ register 4, vertical total
  870LDY #&0E \ decimal 14
  880JSR sheila \ VDU 23;4,14;0;0;0
  890LDX #&06 \ register 6, vertical displayed
  900LDY #&0C \ decimal 12
  910JSR sheila \ VDU 23;6,12;0;0;0
  920INX \ register 7, vertical sync
  930INY \ Y = 13
  940.sheila
  950STX addreg \ select 6845 internal register
  960STY intreg \ store Y in 6845 internal register
  970RTS
  980.down
  990LDA lsb \ low byte of the top LH corner
 1000CLD
 1010CLC
 1020ADC #&28 \ calculate new top LH corner of screen, low byte
 1030STA lsb
 1040LDA msb \ high byte of the top LH corner
 1050ADC #&00 \ calculate new top LH corner of screen, high byte
 1060STA msb
 1070DEC counter
 1080BMI full \ restore full page
 1090BNE scroll \ scroll if not the last line
 1100LDA #&07
 1110JSR oswrch \ beep on the bottom line
 1120BNE scroll \ scroll for the last ime
 1130.full
 1140JSR screenaddr \ address of top LH corner of displayed screen
 1150JSR all \ alter registers 12 and 13
 1160LDX #&00 \ register 0, horizontal total
 1170LDY #&3F \ decimal 63
 1180JSR sheila \ VDU 23;0,63;0;0;0
 1190LDX #&04 \ register 4, vertical total
 1200LDY #&1E \ decimal 30
 1210JSR sheila \ VDU 23;4,30;0;0;0
 1220LDX #&06 \ register 6, vertical displayed
 1230LDY #&19 \ decimal 25
 1240JSR sheila \ VDU 23;6,25;0;0;0
 1250INX \ register 7, vertical sync
 1260LDY #&1B \ decimal 27
 1270JMP sheila \ VDU 23;7,27;0;0;0 and return
 1280.all
 1290LDX #&0C \ register 12, high byte screen start address
 1300LDY msb \ value
 1310JSR sheila \ VDU 23;12,msb;0;0;0
 1320INX \ register 13, low byte screen start address
 1330LDY lsb \ value
 1340JSR sheila \ VDU 23;13,lsb;0;0;0
 1350LDA #&13 \ decimal 19
 1360JMP osbyte \ wait for vertical sync then return
 1370.counter
 1380EQUB &00
 1390.lsb
 1400EQUB &00
 1410.msb
 1420EQUB &00
 1430.oldvector
 1440EQUW &00
 1450.lastbyte
 1460]
 1470NEXT
 1480INPUT"Filename for object code = "save$
 1490IF save$ ="" CALL mcode:END
 1500*OPT1,2
 1510OSCLI("SAVE "+save$+" "+STR$~(&FFFF0000 OR firstbyte)+" "+STR$~(&FFFF0000 OR lastbyte))
 1520*OPT0,0


�> SCROLL
&A%=&EA :�: read Tube presence flag
X%=0
(
Y%=&FF
2"� ((�(&FFF4)�&FF00)�&100)<>0 �
<%zeropage=&70 :�: 2 byte workspace
F,wordv=&20C :�: osword indirection vector
P'mcode=&A00 :�: machine code at &A00
Z;addreg=&FE00 :�: 6845 internal register select register
d9intreg=&FE01 :�: 6845 internal register data register
noswrch=&FFEE
xosbyte=&FFF4
�� pass=0 � 2 � 2
�P%=mcode
�
[OPT pass
�.firstbyte
�&LDX wordv \ osword vector low byte
�)LDY wordv+1 \ osword vector high byte
�8CPY #newcode � 256 \ is the vector already modified?
�*BEQ return \ return if already altered
�=STX oldvector \ save the original osword vector, low byte
�#STY oldvector+1 \ and high byte
�-LDX #newcode � 256 \ low byte of new code
�&LDY #newcode � 256 \ and high byte
�-STX wordv \ alter osword vector, low byte
STY wordv+1 \ and high byte
LDA #&16 \ decimal 22
JSR oswrch
"LDA #&07
,JSR oswrch \ mode 7
6.screenaddr
@LDA #&0D \ decimal 13
J)STA counter \ initialise line counter
T$LDA #&A0 \ read � variable value
^;LDX #&50 \ offset &50 points to start of screen address
hJSR osbyte
r!STX lsb \ X contains low byte
|8TYA \ Y contains high byte, to be modified in Mode 7
�CLD
�SEC
�!SBC #&74 \ by subtracting &74
�� #&20 \ and �ing with #&20
�'STA msb \ Mode 7 modified high byte
�.return
�RTS
�.newcode
�2CMP #&7A \ all ATS osword calls use osword &7A
�%BNE jump \ branch if not from ATS
�7STX zeropage \ X and Y point to the parameter block
�STY zeropage+1
�0LDY #&00 \ index to point to first parameter
+LDA (zeropage),Y \ read first parameter
(CMP #&A0 \ &A0 = unused function key
.BEQ unused \ branch if unused function key
&"LDA #&7A \ restore accumulator
0LDY zeropage+1 \ restore Y
:	.jump
D;JMP (oldvector) \ exit using the original osword vector
N.unused
XINY
bLDA (zeropage),Y
l:CMP #&15 \ 21 = shift+f5, ATS 2.58 unused function key
v"BEQ full \ display full screen
�:CMP #&19 \ 25 = shift+f9, ATS/ATS+ unused function key
�!BEQ down \ scroll down screen
�.up
�+LDA lsb \ low byte of the top LH corner
�CLD
�SEC
�>SBC #&28 \ calculate new top LH corner of screen, low byte
�STA lsb
�,LDA msb \ high byte of the top LH corner
�?SBC #&00 \ calculate new top LH corner of screen, high byte
�STA msb
�INC counter
�1BEQ up \ if on the bottom line subtract again
LDA counter
&CMP #&0E \ are we on the top line?
#BCC scroll \ scroll the picture
 )JSR screenaddr \ re-initialise screen
*.scroll
4+JSR all \ and alter registers 12 and 13
>+LDX #&00 \ register 0, horizontal total
HLDY #&7F \ value 127
R!JSR sheila \ � 23;0,127;0;0;0
\)LDX #&04 \ register 4, vertical total
fLDY #&0E \ decimal 14
p JSR sheila \ � 23;4,14;0;0;0
z-LDX #&06 \ register 6, vertical displayed
�LDY #&0C \ decimal 12
� JSR sheila \ � 23;6,12;0;0;0
�#INX \ register 7, vertical sync
�INY \ Y = 13
�.sheila
�.STX addreg \ select 6845 internal register
�2STY intreg \ store Y in 6845 internal register
�RTS
�	.down
�+LDA lsb \ low byte of the top LH corner
�CLD
�CLC
�>ADC #&28 \ calculate new top LH corner of screen, low byte
STA lsb
,LDA msb \ high byte of the top LH corner
?ADC #&00 \ calculate new top LH corner of screen, high byte
$STA msb
.DEC counter
8 BMI full \ restore full page
B,BNE scroll \ scroll if not the last line
LLDA #&07
V(JSR oswrch \ beep on the bottom line
`(BNE scroll \ scroll for the last ime
j	.full
tAJSR screenaddr \ address of top LH corner of displayed screen
~'JSR all \ alter registers 12 and 13
�+LDX #&00 \ register 0, horizontal total
�LDY #&3F \ decimal 63
� JSR sheila \ � 23;0,63;0;0;0
�)LDX #&04 \ register 4, vertical total
�LDY #&1E \ decimal 30
� JSR sheila \ � 23;4,30;0;0;0
�-LDX #&06 \ register 6, vertical displayed
�LDY #&19 \ decimal 25
� JSR sheila \ � 23;6,25;0;0;0
�#INX \ register 7, vertical sync
�LDY #&1B \ decimal 27
�+JMP sheila \ � 23;7,27;0;0;0 and return
.all

:LDX #&0C \ register 12, high byte screen start address
LDY msb \ value
"JSR sheila \ � 23;12,msb;0;0;0
(4INX \ register 13, low byte screen start address
2LDY lsb \ value
<"JSR sheila \ � 23;13,lsb;0;0;0
FLDA #&13 \ decimal 19
P3JMP osbyte \ wait for vertical sync then return
Z.counter
dEQUB &00
n.lsb
xEQUB &00
�.msb
�EQUB &00
�.oldvector
�EQUW &00
�
.lastbyte
�]
��
�'�"Filename for object code = "save$
�� save$ ="" � mcode:�
�*OPT1,2
�O�("SAVE "+save$+" "+�~(&FFFF0000 � firstbyte)+" "+�~(&FFFF0000 � lastbyte))
�*OPT0,0
�
00000000  0d 00 0a 0d f4 3e 20 53  43 52 4f 4c 4c 0d 00 14  |.....> SCROLL...|
00000010  26 41 25 3d 26 45 41 20  3a f4 3a 20 72 65 61 64  |&A%=&EA :.: read|
00000020  20 54 75 62 65 20 70 72  65 73 65 6e 63 65 20 66  | Tube presence f|
00000030  6c 61 67 0d 00 1e 08 58  25 3d 30 0d 00 28 0a 59  |lag....X%=0..(.Y|
00000040  25 3d 26 46 46 0d 00 32  22 e7 20 28 28 ba 28 26  |%=&FF..2". ((.(&|
00000050  46 46 46 34 29 80 26 46  46 30 30 29 81 26 31 30  |FFF4).&FF00).&10|
00000060  30 29 3c 3e 30 20 e0 0d  00 3c 25 7a 65 72 6f 70  |0)<>0 ...<%zerop|
00000070  61 67 65 3d 26 37 30 20  3a f4 3a 20 32 20 62 79  |age=&70 :.: 2 by|
00000080  74 65 20 77 6f 72 6b 73  70 61 63 65 0d 00 46 2c  |te workspace..F,|
00000090  77 6f 72 64 76 3d 26 32  30 43 20 3a f4 3a 20 6f  |wordv=&20C :.: o|
000000a0  73 77 6f 72 64 20 69 6e  64 69 72 65 63 74 69 6f  |sword indirectio|
000000b0  6e 20 76 65 63 74 6f 72  0d 00 50 27 6d 63 6f 64  |n vector..P'mcod|
000000c0  65 3d 26 41 30 30 20 3a  f4 3a 20 6d 61 63 68 69  |e=&A00 :.: machi|
000000d0  6e 65 20 63 6f 64 65 20  61 74 20 26 41 30 30 0d  |ne code at &A00.|
000000e0  00 5a 3b 61 64 64 72 65  67 3d 26 46 45 30 30 20  |.Z;addreg=&FE00 |
000000f0  3a f4 3a 20 36 38 34 35  20 69 6e 74 65 72 6e 61  |:.: 6845 interna|
00000100  6c 20 72 65 67 69 73 74  65 72 20 73 65 6c 65 63  |l register selec|
00000110  74 20 72 65 67 69 73 74  65 72 0d 00 64 39 69 6e  |t register..d9in|
00000120  74 72 65 67 3d 26 46 45  30 31 20 3a f4 3a 20 36  |treg=&FE01 :.: 6|
00000130  38 34 35 20 69 6e 74 65  72 6e 61 6c 20 72 65 67  |845 internal reg|
00000140  69 73 74 65 72 20 64 61  74 61 20 72 65 67 69 73  |ister data regis|
00000150  74 65 72 0d 00 6e 10 6f  73 77 72 63 68 3d 26 46  |ter..n.oswrch=&F|
00000160  46 45 45 0d 00 78 10 6f  73 62 79 74 65 3d 26 46  |FEE..x.osbyte=&F|
00000170  46 46 34 0d 00 82 14 e3  20 70 61 73 73 3d 30 20  |FF4..... pass=0 |
00000180  b8 20 32 20 88 20 32 0d  00 8c 0c 50 25 3d 6d 63  |. 2 . 2....P%=mc|
00000190  6f 64 65 0d 00 96 0d 5b  4f 50 54 20 70 61 73 73  |ode....[OPT pass|
000001a0  0d 00 a0 0e 2e 66 69 72  73 74 62 79 74 65 0d 00  |.....firstbyte..|
000001b0  aa 26 4c 44 58 20 77 6f  72 64 76 20 5c 20 6f 73  |.&LDX wordv \ os|
000001c0  77 6f 72 64 20 76 65 63  74 6f 72 20 6c 6f 77 20  |word vector low |
000001d0  62 79 74 65 0d 00 b4 29  4c 44 59 20 77 6f 72 64  |byte...)LDY word|
000001e0  76 2b 31 20 5c 20 6f 73  77 6f 72 64 20 76 65 63  |v+1 \ osword vec|
000001f0  74 6f 72 20 68 69 67 68  20 62 79 74 65 0d 00 be  |tor high byte...|
00000200  38 43 50 59 20 23 6e 65  77 63 6f 64 65 20 81 20  |8CPY #newcode . |
00000210  32 35 36 20 5c 20 69 73  20 74 68 65 20 76 65 63  |256 \ is the vec|
00000220  74 6f 72 20 61 6c 72 65  61 64 79 20 6d 6f 64 69  |tor already modi|
00000230  66 69 65 64 3f 0d 00 c8  2a 42 45 51 20 72 65 74  |fied?...*BEQ ret|
00000240  75 72 6e 20 5c 20 72 65  74 75 72 6e 20 69 66 20  |urn \ return if |
00000250  61 6c 72 65 61 64 79 20  61 6c 74 65 72 65 64 0d  |already altered.|
00000260  00 d2 3d 53 54 58 20 6f  6c 64 76 65 63 74 6f 72  |..=STX oldvector|
00000270  20 5c 20 73 61 76 65 20  74 68 65 20 6f 72 69 67  | \ save the orig|
00000280  69 6e 61 6c 20 6f 73 77  6f 72 64 20 76 65 63 74  |inal osword vect|
00000290  6f 72 2c 20 6c 6f 77 20  62 79 74 65 0d 00 dc 23  |or, low byte...#|
000002a0  53 54 59 20 6f 6c 64 76  65 63 74 6f 72 2b 31 20  |STY oldvector+1 |
000002b0  5c 20 61 6e 64 20 68 69  67 68 20 62 79 74 65 0d  |\ and high byte.|
000002c0  00 e6 2d 4c 44 58 20 23  6e 65 77 63 6f 64 65 20  |..-LDX #newcode |
000002d0  83 20 32 35 36 20 5c 20  6c 6f 77 20 62 79 74 65  |. 256 \ low byte|
000002e0  20 6f 66 20 6e 65 77 20  63 6f 64 65 0d 00 f0 26  | of new code...&|
000002f0  4c 44 59 20 23 6e 65 77  63 6f 64 65 20 81 20 32  |LDY #newcode . 2|
00000300  35 36 20 5c 20 61 6e 64  20 68 69 67 68 20 62 79  |56 \ and high by|
00000310  74 65 0d 00 fa 2d 53 54  58 20 77 6f 72 64 76 20  |te...-STX wordv |
00000320  5c 20 61 6c 74 65 72 20  6f 73 77 6f 72 64 20 76  |\ alter osword v|
00000330  65 63 74 6f 72 2c 20 6c  6f 77 20 62 79 74 65 0d  |ector, low byte.|
00000340  01 04 1f 53 54 59 20 77  6f 72 64 76 2b 31 20 5c  |...STY wordv+1 \|
00000350  20 61 6e 64 20 68 69 67  68 20 62 79 74 65 0d 01  | and high byte..|
00000360  0e 19 4c 44 41 20 23 26  31 36 20 5c 20 64 65 63  |..LDA #&16 \ dec|
00000370  69 6d 61 6c 20 32 32 0d  01 18 0e 4a 53 52 20 6f  |imal 22....JSR o|
00000380  73 77 72 63 68 0d 01 22  0c 4c 44 41 20 23 26 30  |swrch..".LDA #&0|
00000390  37 0d 01 2c 17 4a 53 52  20 6f 73 77 72 63 68 20  |7..,.JSR oswrch |
000003a0  5c 20 6d 6f 64 65 20 37  0d 01 36 0f 2e 73 63 72  |\ mode 7..6..scr|
000003b0  65 65 6e 61 64 64 72 0d  01 40 19 4c 44 41 20 23  |eenaddr..@.LDA #|
000003c0  26 30 44 20 5c 20 64 65  63 69 6d 61 6c 20 31 33  |&0D \ decimal 13|
000003d0  0d 01 4a 29 53 54 41 20  63 6f 75 6e 74 65 72 20  |..J)STA counter |
000003e0  5c 20 69 6e 69 74 69 61  6c 69 73 65 20 6c 69 6e  |\ initialise lin|
000003f0  65 20 63 6f 75 6e 74 65  72 0d 01 54 24 4c 44 41  |e counter..T$LDA|
00000400  20 23 26 41 30 20 5c 20  72 65 61 64 20 ef 20 76  | #&A0 \ read . v|
00000410  61 72 69 61 62 6c 65 20  76 61 6c 75 65 0d 01 5e  |ariable value..^|
00000420  3b 4c 44 58 20 23 26 35  30 20 5c 20 6f 66 66 73  |;LDX #&50 \ offs|
00000430  65 74 20 26 35 30 20 70  6f 69 6e 74 73 20 74 6f  |et &50 points to|
00000440  20 73 74 61 72 74 20 6f  66 20 73 63 72 65 65 6e  | start of screen|
00000450  20 61 64 64 72 65 73 73  0d 01 68 0e 4a 53 52 20  | address..h.JSR |
00000460  6f 73 62 79 74 65 0d 01  72 21 53 54 58 20 6c 73  |osbyte..r!STX ls|
00000470  62 20 5c 20 58 20 63 6f  6e 74 61 69 6e 73 20 6c  |b \ X contains l|
00000480  6f 77 20 62 79 74 65 0d  01 7c 38 54 59 41 20 5c  |ow byte..|8TYA \|
00000490  20 59 20 63 6f 6e 74 61  69 6e 73 20 68 69 67 68  | Y contains high|
000004a0  20 62 79 74 65 2c 20 74  6f 20 62 65 20 6d 6f 64  | byte, to be mod|
000004b0  69 66 69 65 64 20 69 6e  20 4d 6f 64 65 20 37 0d  |ified in Mode 7.|
000004c0  01 86 07 43 4c 44 0d 01  90 07 53 45 43 0d 01 9a  |...CLD....SEC...|
000004d0  21 53 42 43 20 23 26 37  34 20 5c 20 62 79 20 73  |!SBC #&74 \ by s|
000004e0  75 62 74 72 61 63 74 69  6e 67 20 26 37 34 0d 01  |ubtracting &74..|
000004f0  a4 1f 82 20 23 26 32 30  20 5c 20 61 6e 64 20 82  |... #&20 \ and .|
00000500  69 6e 67 20 77 69 74 68  20 23 26 32 30 0d 01 ae  |ing with #&20...|
00000510  27 53 54 41 20 6d 73 62  20 5c 20 4d 6f 64 65 20  |'STA msb \ Mode |
00000520  37 20 6d 6f 64 69 66 69  65 64 20 68 69 67 68 20  |7 modified high |
00000530  62 79 74 65 0d 01 b8 0b  2e 72 65 74 75 72 6e 0d  |byte.....return.|
00000540  01 c2 07 52 54 53 0d 01  cc 0c 2e 6e 65 77 63 6f  |...RTS.....newco|
00000550  64 65 0d 01 d6 32 43 4d  50 20 23 26 37 41 20 5c  |de...2CMP #&7A \|
00000560  20 61 6c 6c 20 41 54 53  20 6f 73 77 6f 72 64 20  | all ATS osword |
00000570  63 61 6c 6c 73 20 75 73  65 20 6f 73 77 6f 72 64  |calls use osword|
00000580  20 26 37 41 0d 01 e0 25  42 4e 45 20 6a 75 6d 70  | &7A...%BNE jump|
00000590  20 5c 20 62 72 61 6e 63  68 20 69 66 20 6e 6f 74  | \ branch if not|
000005a0  20 66 72 6f 6d 20 41 54  53 0d 01 ea 37 53 54 58  | from ATS...7STX|
000005b0  20 7a 65 72 6f 70 61 67  65 20 5c 20 58 20 61 6e  | zeropage \ X an|
000005c0  64 20 59 20 70 6f 69 6e  74 20 74 6f 20 74 68 65  |d Y point to the|
000005d0  20 70 61 72 61 6d 65 74  65 72 20 62 6c 6f 63 6b  | parameter block|
000005e0  0d 01 f4 12 53 54 59 20  7a 65 72 6f 70 61 67 65  |....STY zeropage|
000005f0  2b 31 0d 01 fe 30 4c 44  59 20 23 26 30 30 20 5c  |+1...0LDY #&00 \|
00000600  20 69 6e 64 65 78 20 74  6f 20 70 6f 69 6e 74 20  | index to point |
00000610  74 6f 20 66 69 72 73 74  20 70 61 72 61 6d 65 74  |to first paramet|
00000620  65 72 0d 02 08 2b 4c 44  41 20 28 7a 65 72 6f 70  |er...+LDA (zerop|
00000630  61 67 65 29 2c 59 20 5c  20 72 65 61 64 20 66 69  |age),Y \ read fi|
00000640  72 73 74 20 70 61 72 61  6d 65 74 65 72 0d 02 12  |rst parameter...|
00000650  28 43 4d 50 20 23 26 41  30 20 5c 20 26 41 30 20  |(CMP #&A0 \ &A0 |
00000660  3d 20 75 6e 75 73 65 64  20 66 75 6e 63 74 69 6f  |= unused functio|
00000670  6e 20 6b 65 79 0d 02 1c  2e 42 45 51 20 75 6e 75  |n key....BEQ unu|
00000680  73 65 64 20 5c 20 62 72  61 6e 63 68 20 69 66 20  |sed \ branch if |
00000690  75 6e 75 73 65 64 20 66  75 6e 63 74 69 6f 6e 20  |unused function |
000006a0  6b 65 79 0d 02 26 22 4c  44 41 20 23 26 37 41 20  |key..&"LDA #&7A |
000006b0  5c 20 72 65 73 74 6f 72  65 20 61 63 63 75 6d 75  |\ restore accumu|
000006c0  6c 61 74 6f 72 0d 02 30  1e 4c 44 59 20 7a 65 72  |lator..0.LDY zer|
000006d0  6f 70 61 67 65 2b 31 20  5c 20 72 65 73 74 6f 72  |opage+1 \ restor|
000006e0  65 20 59 0d 02 3a 09 2e  6a 75 6d 70 0d 02 44 3b  |e Y..:..jump..D;|
000006f0  4a 4d 50 20 28 6f 6c 64  76 65 63 74 6f 72 29 20  |JMP (oldvector) |
00000700  5c 20 65 78 69 74 20 75  73 69 6e 67 20 74 68 65  |\ exit using the|
00000710  20 6f 72 69 67 69 6e 61  6c 20 6f 73 77 6f 72 64  | original osword|
00000720  20 76 65 63 74 6f 72 0d  02 4e 0b 2e 75 6e 75 73  | vector..N..unus|
00000730  65 64 0d 02 58 07 49 4e  59 0d 02 62 14 4c 44 41  |ed..X.INY..b.LDA|
00000740  20 28 7a 65 72 6f 70 61  67 65 29 2c 59 0d 02 6c  | (zeropage),Y..l|
00000750  3a 43 4d 50 20 23 26 31  35 20 5c 20 32 31 20 3d  |:CMP #&15 \ 21 =|
00000760  20 73 68 69 66 74 2b 66  35 2c 20 41 54 53 20 32  | shift+f5, ATS 2|
00000770  2e 35 38 20 75 6e 75 73  65 64 20 66 75 6e 63 74  |.58 unused funct|
00000780  69 6f 6e 20 6b 65 79 0d  02 76 22 42 45 51 20 66  |ion key..v"BEQ f|
00000790  75 6c 6c 20 5c 20 64 69  73 70 6c 61 79 20 66 75  |ull \ display fu|
000007a0  6c 6c 20 73 63 72 65 65  6e 0d 02 80 3a 43 4d 50  |ll screen...:CMP|
000007b0  20 23 26 31 39 20 5c 20  32 35 20 3d 20 73 68 69  | #&19 \ 25 = shi|
000007c0  66 74 2b 66 39 2c 20 41  54 53 2f 41 54 53 2b 20  |ft+f9, ATS/ATS+ |
000007d0  75 6e 75 73 65 64 20 66  75 6e 63 74 69 6f 6e 20  |unused function |
000007e0  6b 65 79 0d 02 8a 21 42  45 51 20 64 6f 77 6e 20  |key...!BEQ down |
000007f0  5c 20 73 63 72 6f 6c 6c  20 64 6f 77 6e 20 73 63  |\ scroll down sc|
00000800  72 65 65 6e 0d 02 94 07  2e 75 70 0d 02 9e 2b 4c  |reen.....up...+L|
00000810  44 41 20 6c 73 62 20 5c  20 6c 6f 77 20 62 79 74  |DA lsb \ low byt|
00000820  65 20 6f 66 20 74 68 65  20 74 6f 70 20 4c 48 20  |e of the top LH |
00000830  63 6f 72 6e 65 72 0d 02  a8 07 43 4c 44 0d 02 b2  |corner....CLD...|
00000840  07 53 45 43 0d 02 bc 3e  53 42 43 20 23 26 32 38  |.SEC...>SBC #&28|
00000850  20 5c 20 63 61 6c 63 75  6c 61 74 65 20 6e 65 77  | \ calculate new|
00000860  20 74 6f 70 20 4c 48 20  63 6f 72 6e 65 72 20 6f  | top LH corner o|
00000870  66 20 73 63 72 65 65 6e  2c 20 6c 6f 77 20 62 79  |f screen, low by|
00000880  74 65 0d 02 c6 0b 53 54  41 20 6c 73 62 0d 02 d0  |te....STA lsb...|
00000890  2c 4c 44 41 20 6d 73 62  20 5c 20 68 69 67 68 20  |,LDA msb \ high |
000008a0  62 79 74 65 20 6f 66 20  74 68 65 20 74 6f 70 20  |byte of the top |
000008b0  4c 48 20 63 6f 72 6e 65  72 0d 02 da 3f 53 42 43  |LH corner...?SBC|
000008c0  20 23 26 30 30 20 5c 20  63 61 6c 63 75 6c 61 74  | #&00 \ calculat|
000008d0  65 20 6e 65 77 20 74 6f  70 20 4c 48 20 63 6f 72  |e new top LH cor|
000008e0  6e 65 72 20 6f 66 20 73  63 72 65 65 6e 2c 20 68  |ner of screen, h|
000008f0  69 67 68 20 62 79 74 65  0d 02 e4 0b 53 54 41 20  |igh byte....STA |
00000900  6d 73 62 0d 02 ee 0f 49  4e 43 20 63 6f 75 6e 74  |msb....INC count|
00000910  65 72 0d 02 f8 31 42 45  51 20 75 70 20 5c 20 69  |er...1BEQ up \ i|
00000920  66 20 6f 6e 20 74 68 65  20 62 6f 74 74 6f 6d 20  |f on the bottom |
00000930  6c 69 6e 65 20 73 75 62  74 72 61 63 74 20 61 67  |line subtract ag|
00000940  61 69 6e 0d 03 02 0f 4c  44 41 20 63 6f 75 6e 74  |ain....LDA count|
00000950  65 72 0d 03 0c 26 43 4d  50 20 23 26 30 45 20 5c  |er...&CMP #&0E \|
00000960  20 61 72 65 20 77 65 20  6f 6e 20 74 68 65 20 74  | are we on the t|
00000970  6f 70 20 6c 69 6e 65 3f  0d 03 16 23 42 43 43 20  |op line?...#BCC |
00000980  73 63 72 6f 6c 6c 20 5c  20 73 63 72 6f 6c 6c 20  |scroll \ scroll |
00000990  74 68 65 20 70 69 63 74  75 72 65 0d 03 20 29 4a  |the picture.. )J|
000009a0  53 52 20 73 63 72 65 65  6e 61 64 64 72 20 5c 20  |SR screenaddr \ |
000009b0  72 65 2d 69 6e 69 74 69  61 6c 69 73 65 20 73 63  |re-initialise sc|
000009c0  72 65 65 6e 0d 03 2a 0b  2e 73 63 72 6f 6c 6c 0d  |reen..*..scroll.|
000009d0  03 34 2b 4a 53 52 20 61  6c 6c 20 5c 20 61 6e 64  |.4+JSR all \ and|
000009e0  20 61 6c 74 65 72 20 72  65 67 69 73 74 65 72 73  | alter registers|
000009f0  20 31 32 20 61 6e 64 20  31 33 0d 03 3e 2b 4c 44  | 12 and 13..>+LD|
00000a00  58 20 23 26 30 30 20 5c  20 72 65 67 69 73 74 65  |X #&00 \ registe|
00000a10  72 20 30 2c 20 68 6f 72  69 7a 6f 6e 74 61 6c 20  |r 0, horizontal |
00000a20  74 6f 74 61 6c 0d 03 48  18 4c 44 59 20 23 26 37  |total..H.LDY #&7|
00000a30  46 20 5c 20 76 61 6c 75  65 20 31 32 37 0d 03 52  |F \ value 127..R|
00000a40  21 4a 53 52 20 73 68 65  69 6c 61 20 5c 20 ef 20  |!JSR sheila \ . |
00000a50  32 33 3b 30 2c 31 32 37  3b 30 3b 30 3b 30 0d 03  |23;0,127;0;0;0..|
00000a60  5c 29 4c 44 58 20 23 26  30 34 20 5c 20 72 65 67  |\)LDX #&04 \ reg|
00000a70  69 73 74 65 72 20 34 2c  20 76 65 72 74 69 63 61  |ister 4, vertica|
00000a80  6c 20 74 6f 74 61 6c 0d  03 66 19 4c 44 59 20 23  |l total..f.LDY #|
00000a90  26 30 45 20 5c 20 64 65  63 69 6d 61 6c 20 31 34  |&0E \ decimal 14|
00000aa0  0d 03 70 20 4a 53 52 20  73 68 65 69 6c 61 20 5c  |..p JSR sheila \|
00000ab0  20 ef 20 32 33 3b 34 2c  31 34 3b 30 3b 30 3b 30  | . 23;4,14;0;0;0|
00000ac0  0d 03 7a 2d 4c 44 58 20  23 26 30 36 20 5c 20 72  |..z-LDX #&06 \ r|
00000ad0  65 67 69 73 74 65 72 20  36 2c 20 76 65 72 74 69  |egister 6, verti|
00000ae0  63 61 6c 20 64 69 73 70  6c 61 79 65 64 0d 03 84  |cal displayed...|
00000af0  19 4c 44 59 20 23 26 30  43 20 5c 20 64 65 63 69  |.LDY #&0C \ deci|
00000b00  6d 61 6c 20 31 32 0d 03  8e 20 4a 53 52 20 73 68  |mal 12... JSR sh|
00000b10  65 69 6c 61 20 5c 20 ef  20 32 33 3b 36 2c 31 32  |eila \ . 23;6,12|
00000b20  3b 30 3b 30 3b 30 0d 03  98 23 49 4e 58 20 5c 20  |;0;0;0...#INX \ |
00000b30  72 65 67 69 73 74 65 72  20 37 2c 20 76 65 72 74  |register 7, vert|
00000b40  69 63 61 6c 20 73 79 6e  63 0d 03 a2 10 49 4e 59  |ical sync....INY|
00000b50  20 5c 20 59 20 3d 20 31  33 0d 03 ac 0b 2e 73 68  | \ Y = 13.....sh|
00000b60  65 69 6c 61 0d 03 b6 2e  53 54 58 20 61 64 64 72  |eila....STX addr|
00000b70  65 67 20 5c 20 73 65 6c  65 63 74 20 36 38 34 35  |eg \ select 6845|
00000b80  20 69 6e 74 65 72 6e 61  6c 20 72 65 67 69 73 74  | internal regist|
00000b90  65 72 0d 03 c0 32 53 54  59 20 69 6e 74 72 65 67  |er...2STY intreg|
00000ba0  20 5c 20 73 74 6f 72 65  20 59 20 69 6e 20 36 38  | \ store Y in 68|
00000bb0  34 35 20 69 6e 74 65 72  6e 61 6c 20 72 65 67 69  |45 internal regi|
00000bc0  73 74 65 72 0d 03 ca 07  52 54 53 0d 03 d4 09 2e  |ster....RTS.....|
00000bd0  64 6f 77 6e 0d 03 de 2b  4c 44 41 20 6c 73 62 20  |down...+LDA lsb |
00000be0  5c 20 6c 6f 77 20 62 79  74 65 20 6f 66 20 74 68  |\ low byte of th|
00000bf0  65 20 74 6f 70 20 4c 48  20 63 6f 72 6e 65 72 0d  |e top LH corner.|
00000c00  03 e8 07 43 4c 44 0d 03  f2 07 43 4c 43 0d 03 fc  |...CLD....CLC...|
00000c10  3e 41 44 43 20 23 26 32  38 20 5c 20 63 61 6c 63  |>ADC #&28 \ calc|
00000c20  75 6c 61 74 65 20 6e 65  77 20 74 6f 70 20 4c 48  |ulate new top LH|
00000c30  20 63 6f 72 6e 65 72 20  6f 66 20 73 63 72 65 65  | corner of scree|
00000c40  6e 2c 20 6c 6f 77 20 62  79 74 65 0d 04 06 0b 53  |n, low byte....S|
00000c50  54 41 20 6c 73 62 0d 04  10 2c 4c 44 41 20 6d 73  |TA lsb...,LDA ms|
00000c60  62 20 5c 20 68 69 67 68  20 62 79 74 65 20 6f 66  |b \ high byte of|
00000c70  20 74 68 65 20 74 6f 70  20 4c 48 20 63 6f 72 6e  | the top LH corn|
00000c80  65 72 0d 04 1a 3f 41 44  43 20 23 26 30 30 20 5c  |er...?ADC #&00 \|
00000c90  20 63 61 6c 63 75 6c 61  74 65 20 6e 65 77 20 74  | calculate new t|
00000ca0  6f 70 20 4c 48 20 63 6f  72 6e 65 72 20 6f 66 20  |op LH corner of |
00000cb0  73 63 72 65 65 6e 2c 20  68 69 67 68 20 62 79 74  |screen, high byt|
00000cc0  65 0d 04 24 0b 53 54 41  20 6d 73 62 0d 04 2e 0f  |e..$.STA msb....|
00000cd0  44 45 43 20 63 6f 75 6e  74 65 72 0d 04 38 20 42  |DEC counter..8 B|
00000ce0  4d 49 20 66 75 6c 6c 20  5c 20 72 65 73 74 6f 72  |MI full \ restor|
00000cf0  65 20 66 75 6c 6c 20 70  61 67 65 0d 04 42 2c 42  |e full page..B,B|
00000d00  4e 45 20 73 63 72 6f 6c  6c 20 5c 20 73 63 72 6f  |NE scroll \ scro|
00000d10  6c 6c 20 69 66 20 6e 6f  74 20 74 68 65 20 6c 61  |ll if not the la|
00000d20  73 74 20 6c 69 6e 65 0d  04 4c 0c 4c 44 41 20 23  |st line..L.LDA #|
00000d30  26 30 37 0d 04 56 28 4a  53 52 20 6f 73 77 72 63  |&07..V(JSR oswrc|
00000d40  68 20 5c 20 62 65 65 70  20 6f 6e 20 74 68 65 20  |h \ beep on the |
00000d50  62 6f 74 74 6f 6d 20 6c  69 6e 65 0d 04 60 28 42  |bottom line..`(B|
00000d60  4e 45 20 73 63 72 6f 6c  6c 20 5c 20 73 63 72 6f  |NE scroll \ scro|
00000d70  6c 6c 20 66 6f 72 20 74  68 65 20 6c 61 73 74 20  |ll for the last |
00000d80  69 6d 65 0d 04 6a 09 2e  66 75 6c 6c 0d 04 74 41  |ime..j..full..tA|
00000d90  4a 53 52 20 73 63 72 65  65 6e 61 64 64 72 20 5c  |JSR screenaddr \|
00000da0  20 61 64 64 72 65 73 73  20 6f 66 20 74 6f 70 20  | address of top |
00000db0  4c 48 20 63 6f 72 6e 65  72 20 6f 66 20 64 69 73  |LH corner of dis|
00000dc0  70 6c 61 79 65 64 20 73  63 72 65 65 6e 0d 04 7e  |played screen..~|
00000dd0  27 4a 53 52 20 61 6c 6c  20 5c 20 61 6c 74 65 72  |'JSR all \ alter|
00000de0  20 72 65 67 69 73 74 65  72 73 20 31 32 20 61 6e  | registers 12 an|
00000df0  64 20 31 33 0d 04 88 2b  4c 44 58 20 23 26 30 30  |d 13...+LDX #&00|
00000e00  20 5c 20 72 65 67 69 73  74 65 72 20 30 2c 20 68  | \ register 0, h|
00000e10  6f 72 69 7a 6f 6e 74 61  6c 20 74 6f 74 61 6c 0d  |orizontal total.|
00000e20  04 92 19 4c 44 59 20 23  26 33 46 20 5c 20 64 65  |...LDY #&3F \ de|
00000e30  63 69 6d 61 6c 20 36 33  0d 04 9c 20 4a 53 52 20  |cimal 63... JSR |
00000e40  73 68 65 69 6c 61 20 5c  20 ef 20 32 33 3b 30 2c  |sheila \ . 23;0,|
00000e50  36 33 3b 30 3b 30 3b 30  0d 04 a6 29 4c 44 58 20  |63;0;0;0...)LDX |
00000e60  23 26 30 34 20 5c 20 72  65 67 69 73 74 65 72 20  |#&04 \ register |
00000e70  34 2c 20 76 65 72 74 69  63 61 6c 20 74 6f 74 61  |4, vertical tota|
00000e80  6c 0d 04 b0 19 4c 44 59  20 23 26 31 45 20 5c 20  |l....LDY #&1E \ |
00000e90  64 65 63 69 6d 61 6c 20  33 30 0d 04 ba 20 4a 53  |decimal 30... JS|
00000ea0  52 20 73 68 65 69 6c 61  20 5c 20 ef 20 32 33 3b  |R sheila \ . 23;|
00000eb0  34 2c 33 30 3b 30 3b 30  3b 30 0d 04 c4 2d 4c 44  |4,30;0;0;0...-LD|
00000ec0  58 20 23 26 30 36 20 5c  20 72 65 67 69 73 74 65  |X #&06 \ registe|
00000ed0  72 20 36 2c 20 76 65 72  74 69 63 61 6c 20 64 69  |r 6, vertical di|
00000ee0  73 70 6c 61 79 65 64 0d  04 ce 19 4c 44 59 20 23  |splayed....LDY #|
00000ef0  26 31 39 20 5c 20 64 65  63 69 6d 61 6c 20 32 35  |&19 \ decimal 25|
00000f00  0d 04 d8 20 4a 53 52 20  73 68 65 69 6c 61 20 5c  |... JSR sheila \|
00000f10  20 ef 20 32 33 3b 36 2c  32 35 3b 30 3b 30 3b 30  | . 23;6,25;0;0;0|
00000f20  0d 04 e2 23 49 4e 58 20  5c 20 72 65 67 69 73 74  |...#INX \ regist|
00000f30  65 72 20 37 2c 20 76 65  72 74 69 63 61 6c 20 73  |er 7, vertical s|
00000f40  79 6e 63 0d 04 ec 19 4c  44 59 20 23 26 31 42 20  |ync....LDY #&1B |
00000f50  5c 20 64 65 63 69 6d 61  6c 20 32 37 0d 04 f6 2b  |\ decimal 27...+|
00000f60  4a 4d 50 20 73 68 65 69  6c 61 20 5c 20 ef 20 32  |JMP sheila \ . 2|
00000f70  33 3b 37 2c 32 37 3b 30  3b 30 3b 30 20 61 6e 64  |3;7,27;0;0;0 and|
00000f80  20 72 65 74 75 72 6e 0d  05 00 08 2e 61 6c 6c 0d  | return.....all.|
00000f90  05 0a 3a 4c 44 58 20 23  26 30 43 20 5c 20 72 65  |..:LDX #&0C \ re|
00000fa0  67 69 73 74 65 72 20 31  32 2c 20 68 69 67 68 20  |gister 12, high |
00000fb0  62 79 74 65 20 73 63 72  65 65 6e 20 73 74 61 72  |byte screen star|
00000fc0  74 20 61 64 64 72 65 73  73 0d 05 14 13 4c 44 59  |t address....LDY|
00000fd0  20 6d 73 62 20 5c 20 76  61 6c 75 65 0d 05 1e 22  | msb \ value..."|
00000fe0  4a 53 52 20 73 68 65 69  6c 61 20 5c 20 ef 20 32  |JSR sheila \ . 2|
00000ff0  33 3b 31 32 2c 6d 73 62  3b 30 3b 30 3b 30 0d 05  |3;12,msb;0;0;0..|
00001000  28 34 49 4e 58 20 5c 20  72 65 67 69 73 74 65 72  |(4INX \ register|
00001010  20 31 33 2c 20 6c 6f 77  20 62 79 74 65 20 73 63  | 13, low byte sc|
00001020  72 65 65 6e 20 73 74 61  72 74 20 61 64 64 72 65  |reen start addre|
00001030  73 73 0d 05 32 13 4c 44  59 20 6c 73 62 20 5c 20  |ss..2.LDY lsb \ |
00001040  76 61 6c 75 65 0d 05 3c  22 4a 53 52 20 73 68 65  |value..<"JSR she|
00001050  69 6c 61 20 5c 20 ef 20  32 33 3b 31 33 2c 6c 73  |ila \ . 23;13,ls|
00001060  62 3b 30 3b 30 3b 30 0d  05 46 19 4c 44 41 20 23  |b;0;0;0..F.LDA #|
00001070  26 31 33 20 5c 20 64 65  63 69 6d 61 6c 20 31 39  |&13 \ decimal 19|
00001080  0d 05 50 33 4a 4d 50 20  6f 73 62 79 74 65 20 5c  |..P3JMP osbyte \|
00001090  20 77 61 69 74 20 66 6f  72 20 76 65 72 74 69 63  | wait for vertic|
000010a0  61 6c 20 73 79 6e 63 20  74 68 65 6e 20 72 65 74  |al sync then ret|
000010b0  75 72 6e 0d 05 5a 0c 2e  63 6f 75 6e 74 65 72 0d  |urn..Z..counter.|
000010c0  05 64 0c 45 51 55 42 20  26 30 30 0d 05 6e 08 2e  |.d.EQUB &00..n..|
000010d0  6c 73 62 0d 05 78 0c 45  51 55 42 20 26 30 30 0d  |lsb..x.EQUB &00.|
000010e0  05 82 08 2e 6d 73 62 0d  05 8c 0c 45 51 55 42 20  |....msb....EQUB |
000010f0  26 30 30 0d 05 96 0e 2e  6f 6c 64 76 65 63 74 6f  |&00.....oldvecto|
00001100  72 0d 05 a0 0c 45 51 55  57 20 26 30 30 0d 05 aa  |r....EQUW &00...|
00001110  0d 2e 6c 61 73 74 62 79  74 65 0d 05 b4 05 5d 0d  |..lastbyte....].|
00001120  05 be 05 ed 0d 05 c8 27  e8 22 46 69 6c 65 6e 61  |.......'."Filena|
00001130  6d 65 20 66 6f 72 20 6f  62 6a 65 63 74 20 63 6f  |me for object co|
00001140  64 65 20 3d 20 22 73 61  76 65 24 0d 05 d2 19 e7  |de = "save$.....|
00001150  20 73 61 76 65 24 20 3d  22 22 20 d6 20 6d 63 6f  | save$ ="" . mco|
00001160  64 65 3a e0 0d 05 dc 0b  2a 4f 50 54 31 2c 32 0d  |de:.....*OPT1,2.|
00001170  05 e6 4f ff 28 22 53 41  56 45 20 22 2b 73 61 76  |..O.("SAVE "+sav|
00001180  65 24 2b 22 20 22 2b c3  7e 28 26 46 46 46 46 30  |e$+" "+.~(&FFFF0|
00001190  30 30 30 20 84 20 66 69  72 73 74 62 79 74 65 29  |000 . firstbyte)|
000011a0  2b 22 20 22 2b c3 7e 28  26 46 46 46 46 30 30 30  |+" "+.~(&FFFF000|
000011b0  30 20 84 20 6c 61 73 74  62 79 74 65 29 29 0d 05  |0 . lastbyte))..|
000011c0  f0 0b 2a 4f 50 54 30 2c  30 0d ff                 |..*OPT0,0..|
000011cb
05-03-89/Scroll.m0
05-03-89/Scroll.m1
05-03-89/Scroll.m2
05-03-89/Scroll.m4
05-03-89/Scroll.m5