Home » CEEFAX disks » telesoftware3.adl » 21_11_87/CURSOR

21_11_87/CURSOR

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 » telesoftware3.adl
Filename: 21_11_87/CURSOR
Read OK:
File size: 06B7 bytes
Load address: 1900
Exec address: 8023
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM: CURSOR
   20MODE7
   30HIMEM=&3C00
   40DIM save 50
   50diff=&8000-HIMEM
   60comvec=&F2
   70gsinit=&FFC2
   80gsread=&FFC5
   90osasci=&FFE3
  100oscli=&FFF7
  110FOR pass = 0 TO 2 STEP 2
  120P%=HIMEM
  130[OPT pass
  140BRK
  150BRK
  160BRK
  170JMP service+diff
  180OPT FNequb(&82)
  190OPT FNequb((copyright+diff) MOD 256)
  200BRK
  210.title
  220OPT FNequs("CURSOR")
  230.copyright
  240BRK
  250OPT FNequs("(C) Gordon Horsington 1987")
  260BRK
  270.service
  280CMP #4
  290BEQ unrecognised
  300RTS
  310.unrecognised
  320PHA
  330TXA
  340PHA
  350TYA
  360PHA
  370LDX #&FF
  380.comloop
  390INX
  400LDA title+diff,X
  410BEQ found
  420LDA (comvec),Y
  430INY
  440CMP #ASC(".")
  450BEQ found
  460AND #&DF
  470CMP title+diff,X
  480BEQ comloop
  490PLA
  500TAY
  510PLA
  520TAX
  530PLA
  540RTS
  550.found
  560SEC \ Terminate with space, Return or "
  570JSR gsinit
  580BEQ exit \ Branch if null argument
  590INY \ First character must be "O"
  600JSR gsread \ Second character "F" or "N"
  610BCS exit \ Branch if end of argument
  620AND #&DF \ Upper case
  630CMP #ASC("F")
  640BEQ cursoroff
  650CMP #ASC("N")
  660BNE exit
  670SEC
  680BCS cursor
  690.cursoroff
  700CLC
  710.cursor
  720PHP
  730LDA #23
  740JSR osasci
  750LDA #1
  760JSR osasci
  770PLA
  780AND #1
  790JSR osasci
  800LDA #0
  810LDX #7
  820.cursorloop
  830JSR osasci
  840DEX
  850BNE cursorloop
  860.exit
  870PLA
  880PLA
  890PLA
  900LDA #0
  910RTS
  920.lastbyte
  930]
  940NEXT
  950INPUT'"Save filename = "filename$
  960IF filename$="" END
  970$save="SAVE "+filename$+" "+STR$~(HIMEM)+" "+STR$~(lastbyte)+" FFFF8000 FFFF8000"
  980X%=save MOD 256
  990Y%=save DIV 256
 1000*OPT1,2
 1010CALL oscli
 1020*OPT1,0
 1030END
 1040DEFFNequb(byte)
 1050?P%=byte
 1060P%=P%+1
 1070=pass
 1080DEFFNequw(word)
 1090?P%=word MOD 256
 1100P%?1=word DIV 256
 1110P%=P%+2
 1120=pass
 1130DEFFNequd(double)
 1140!P%=double
 1150P%=P%+4
 1160=pass
 1170DEFFNequs(string$)
 1180$P%=string$
 1190P%=P%+LEN(string$)
 1200=pass


�: CURSOR
�7
�=&3C00
(
� save 50
2diff=&8000-�
<comvec=&F2
Fgsinit=&FFC2
Pgsread=&FFC5
Zosasci=&FFE3
doscli=&FFF7
n� pass = 0 � 2 � 2
xP%=�
�
[OPT pass
�BRK
�BRK
�BRK
�JMP service+diff
�OPT �equb(&82)
�%OPT �equb((copyright+diff) � 256)
�BRK
�
.title
�OPT �equs("CURSOR")
�.copyright
�BRK
�+OPT �equs("(C) Gordon Horsington 1987")
BRK
.service

CMP #4
"BEQ unrecognised
,RTS
6.unrecognised
@PHA
JTXA
TPHA
^TYA
hPHA
rLDX #&FF
|.comloop
�INX
�LDA title+diff,X
�
BEQ found
�LDA (comvec),Y
�INY
�CMP #�(".")
�
BEQ found
�
� #&DF
�CMP title+diff,X
�BEQ comloop
�PLA
�TAY
�PLA
TAX
PLA
RTS
&
.found
0+SEC \ Terminate with space, Return or "
:JSR gsinit
D&BEQ exit \ Branch if null argument
N%INY \ First character must be "O"
X,JSR gsread \ Second character "F" or "N"
b(BCS exit \ Branch if end of argument
l� #&DF \ Upper case
vCMP #�("F")
�BEQ cursoroff
�CMP #�("N")
�BNE exit
�SEC
�BCS cursor
�.cursoroff
�CLC
�.cursor
�PHP
�LDA #23
�JSR osasci
�
LDA #1
�JSR osasci
PLA
� #1
JSR osasci
 
LDA #0
*
LDX #7
4.cursorloop
>JSR osasci
HDEX
RBNE cursorloop
\	.exit
fPLA
pPLA
zPLA
�
LDA #0
�RTS
�
.lastbyte
�]
��
�!�'"Save filename = "filename$
�� filename$="" �
�K$save="SAVE "+filename$+" "+�~(�)+" "+�~(lastbyte)+" FFFF8000 FFFF8000"
�X%=save � 256
�Y%=save � 256
�*OPT1,2
�� oscli
�*OPT1,0
�
ݤequb(byte)
?P%=byte
$P%=P%+1
.	=pass
8ݤequw(word)
B?P%=word � 256
LP%?1=word � 256
VP%=P%+2
`	=pass
jݤequd(double)
t!P%=double
~P%=P%+4
�	=pass
�ݤequs(string$)
�$P%=string$
�P%=P%+�(string$)
�	=pass
�
00000000  0d 00 0a 0d f4 3a 20 43  55 52 53 4f 52 0d 00 14  |.....: CURSOR...|
00000010  06 eb 37 0d 00 1e 0b d3  3d 26 33 43 30 30 0d 00  |..7.....=&3C00..|
00000020  28 0d de 20 73 61 76 65  20 35 30 0d 00 32 10 64  |(.. save 50..2.d|
00000030  69 66 66 3d 26 38 30 30  30 2d 93 0d 00 3c 0e 63  |iff=&8000-...<.c|
00000040  6f 6d 76 65 63 3d 26 46  32 0d 00 46 10 67 73 69  |omvec=&F2..F.gsi|
00000050  6e 69 74 3d 26 46 46 43  32 0d 00 50 10 67 73 72  |nit=&FFC2..P.gsr|
00000060  65 61 64 3d 26 46 46 43  35 0d 00 5a 10 6f 73 61  |ead=&FFC5..Z.osa|
00000070  73 63 69 3d 26 46 46 45  33 0d 00 64 0f 6f 73 63  |sci=&FFE3..d.osc|
00000080  6c 69 3d 26 46 46 46 37  0d 00 6e 16 e3 20 70 61  |li=&FFF7..n.. pa|
00000090  73 73 20 3d 20 30 20 b8  20 32 20 88 20 32 0d 00  |ss = 0 . 2 . 2..|
000000a0  78 08 50 25 3d 93 0d 00  82 0d 5b 4f 50 54 20 70  |x.P%=.....[OPT p|
000000b0  61 73 73 0d 00 8c 07 42  52 4b 0d 00 96 07 42 52  |ass....BRK....BR|
000000c0  4b 0d 00 a0 07 42 52 4b  0d 00 aa 14 4a 4d 50 20  |K....BRK....JMP |
000000d0  73 65 72 76 69 63 65 2b  64 69 66 66 0d 00 b4 12  |service+diff....|
000000e0  4f 50 54 20 a4 65 71 75  62 28 26 38 32 29 0d 00  |OPT .equb(&82)..|
000000f0  be 25 4f 50 54 20 a4 65  71 75 62 28 28 63 6f 70  |.%OPT .equb((cop|
00000100  79 72 69 67 68 74 2b 64  69 66 66 29 20 83 20 32  |yright+diff) . 2|
00000110  35 36 29 0d 00 c8 07 42  52 4b 0d 00 d2 0a 2e 74  |56)....BRK.....t|
00000120  69 74 6c 65 0d 00 dc 17  4f 50 54 20 a4 65 71 75  |itle....OPT .equ|
00000130  73 28 22 43 55 52 53 4f  52 22 29 0d 00 e6 0e 2e  |s("CURSOR").....|
00000140  63 6f 70 79 72 69 67 68  74 0d 00 f0 07 42 52 4b  |copyright....BRK|
00000150  0d 00 fa 2b 4f 50 54 20  a4 65 71 75 73 28 22 28  |...+OPT .equs("(|
00000160  43 29 20 47 6f 72 64 6f  6e 20 48 6f 72 73 69 6e  |C) Gordon Horsin|
00000170  67 74 6f 6e 20 31 39 38  37 22 29 0d 01 04 07 42  |gton 1987")....B|
00000180  52 4b 0d 01 0e 0c 2e 73  65 72 76 69 63 65 0d 01  |RK.....service..|
00000190  18 0a 43 4d 50 20 23 34  0d 01 22 14 42 45 51 20  |..CMP #4..".BEQ |
000001a0  75 6e 72 65 63 6f 67 6e  69 73 65 64 0d 01 2c 07  |unrecognised..,.|
000001b0  52 54 53 0d 01 36 11 2e  75 6e 72 65 63 6f 67 6e  |RTS..6..unrecogn|
000001c0  69 73 65 64 0d 01 40 07  50 48 41 0d 01 4a 07 54  |ised..@.PHA..J.T|
000001d0  58 41 0d 01 54 07 50 48  41 0d 01 5e 07 54 59 41  |XA..T.PHA..^.TYA|
000001e0  0d 01 68 07 50 48 41 0d  01 72 0c 4c 44 58 20 23  |..h.PHA..r.LDX #|
000001f0  26 46 46 0d 01 7c 0c 2e  63 6f 6d 6c 6f 6f 70 0d  |&FF..|..comloop.|
00000200  01 86 07 49 4e 58 0d 01  90 14 4c 44 41 20 74 69  |...INX....LDA ti|
00000210  74 6c 65 2b 64 69 66 66  2c 58 0d 01 9a 0d 42 45  |tle+diff,X....BE|
00000220  51 20 66 6f 75 6e 64 0d  01 a4 12 4c 44 41 20 28  |Q found....LDA (|
00000230  63 6f 6d 76 65 63 29 2c  59 0d 01 ae 07 49 4e 59  |comvec),Y....INY|
00000240  0d 01 b8 0f 43 4d 50 20  23 97 28 22 2e 22 29 0d  |....CMP #.(".").|
00000250  01 c2 0d 42 45 51 20 66  6f 75 6e 64 0d 01 cc 0a  |...BEQ found....|
00000260  80 20 23 26 44 46 0d 01  d6 14 43 4d 50 20 74 69  |. #&DF....CMP ti|
00000270  74 6c 65 2b 64 69 66 66  2c 58 0d 01 e0 0f 42 45  |tle+diff,X....BE|
00000280  51 20 63 6f 6d 6c 6f 6f  70 0d 01 ea 07 50 4c 41  |Q comloop....PLA|
00000290  0d 01 f4 07 54 41 59 0d  01 fe 07 50 4c 41 0d 02  |....TAY....PLA..|
000002a0  08 07 54 41 58 0d 02 12  07 50 4c 41 0d 02 1c 07  |..TAX....PLA....|
000002b0  52 54 53 0d 02 26 0a 2e  66 6f 75 6e 64 0d 02 30  |RTS..&..found..0|
000002c0  2b 53 45 43 20 5c 20 54  65 72 6d 69 6e 61 74 65  |+SEC \ Terminate|
000002d0  20 77 69 74 68 20 73 70  61 63 65 2c 20 52 65 74  | with space, Ret|
000002e0  75 72 6e 20 6f 72 20 22  0d 02 3a 0e 4a 53 52 20  |urn or "..:.JSR |
000002f0  67 73 69 6e 69 74 0d 02  44 26 42 45 51 20 65 78  |gsinit..D&BEQ ex|
00000300  69 74 20 5c 20 42 72 61  6e 63 68 20 69 66 20 6e  |it \ Branch if n|
00000310  75 6c 6c 20 61 72 67 75  6d 65 6e 74 0d 02 4e 25  |ull argument..N%|
00000320  49 4e 59 20 5c 20 46 69  72 73 74 20 63 68 61 72  |INY \ First char|
00000330  61 63 74 65 72 20 6d 75  73 74 20 62 65 20 22 4f  |acter must be "O|
00000340  22 0d 02 58 2c 4a 53 52  20 67 73 72 65 61 64 20  |"..X,JSR gsread |
00000350  5c 20 53 65 63 6f 6e 64  20 63 68 61 72 61 63 74  |\ Second charact|
00000360  65 72 20 22 46 22 20 6f  72 20 22 4e 22 0d 02 62  |er "F" or "N"..b|
00000370  28 42 43 53 20 65 78 69  74 20 5c 20 42 72 61 6e  |(BCS exit \ Bran|
00000380  63 68 20 69 66 20 65 6e  64 20 6f 66 20 61 72 67  |ch if end of arg|
00000390  75 6d 65 6e 74 0d 02 6c  17 80 20 23 26 44 46 20  |ument..l.. #&DF |
000003a0  5c 20 55 70 70 65 72 20  63 61 73 65 0d 02 76 0f  |\ Upper case..v.|
000003b0  43 4d 50 20 23 97 28 22  46 22 29 0d 02 80 11 42  |CMP #.("F")....B|
000003c0  45 51 20 63 75 72 73 6f  72 6f 66 66 0d 02 8a 0f  |EQ cursoroff....|
000003d0  43 4d 50 20 23 97 28 22  4e 22 29 0d 02 94 0c 42  |CMP #.("N")....B|
000003e0  4e 45 20 65 78 69 74 0d  02 9e 07 53 45 43 0d 02  |NE exit....SEC..|
000003f0  a8 0e 42 43 53 20 63 75  72 73 6f 72 0d 02 b2 0e  |..BCS cursor....|
00000400  2e 63 75 72 73 6f 72 6f  66 66 0d 02 bc 07 43 4c  |.cursoroff....CL|
00000410  43 0d 02 c6 0b 2e 63 75  72 73 6f 72 0d 02 d0 07  |C.....cursor....|
00000420  50 48 50 0d 02 da 0b 4c  44 41 20 23 32 33 0d 02  |PHP....LDA #23..|
00000430  e4 0e 4a 53 52 20 6f 73  61 73 63 69 0d 02 ee 0a  |..JSR osasci....|
00000440  4c 44 41 20 23 31 0d 02  f8 0e 4a 53 52 20 6f 73  |LDA #1....JSR os|
00000450  61 73 63 69 0d 03 02 07  50 4c 41 0d 03 0c 08 80  |asci....PLA.....|
00000460  20 23 31 0d 03 16 0e 4a  53 52 20 6f 73 61 73 63  | #1....JSR osasc|
00000470  69 0d 03 20 0a 4c 44 41  20 23 30 0d 03 2a 0a 4c  |i.. .LDA #0..*.L|
00000480  44 58 20 23 37 0d 03 34  0f 2e 63 75 72 73 6f 72  |DX #7..4..cursor|
00000490  6c 6f 6f 70 0d 03 3e 0e  4a 53 52 20 6f 73 61 73  |loop..>.JSR osas|
000004a0  63 69 0d 03 48 07 44 45  58 0d 03 52 12 42 4e 45  |ci..H.DEX..R.BNE|
000004b0  20 63 75 72 73 6f 72 6c  6f 6f 70 0d 03 5c 09 2e  | cursorloop..\..|
000004c0  65 78 69 74 0d 03 66 07  50 4c 41 0d 03 70 07 50  |exit..f.PLA..p.P|
000004d0  4c 41 0d 03 7a 07 50 4c  41 0d 03 84 0a 4c 44 41  |LA..z.PLA....LDA|
000004e0  20 23 30 0d 03 8e 07 52  54 53 0d 03 98 0d 2e 6c  | #0....RTS.....l|
000004f0  61 73 74 62 79 74 65 0d  03 a2 05 5d 0d 03 ac 05  |astbyte....]....|
00000500  ed 0d 03 b6 21 e8 27 22  53 61 76 65 20 66 69 6c  |....!.'"Save fil|
00000510  65 6e 61 6d 65 20 3d 20  22 66 69 6c 65 6e 61 6d  |ename = "filenam|
00000520  65 24 0d 03 c0 14 e7 20  66 69 6c 65 6e 61 6d 65  |e$..... filename|
00000530  24 3d 22 22 20 e0 0d 03  ca 4b 24 73 61 76 65 3d  |$="" ....K$save=|
00000540  22 53 41 56 45 20 22 2b  66 69 6c 65 6e 61 6d 65  |"SAVE "+filename|
00000550  24 2b 22 20 22 2b c3 7e  28 93 29 2b 22 20 22 2b  |$+" "+.~(.)+" "+|
00000560  c3 7e 28 6c 61 73 74 62  79 74 65 29 2b 22 20 46  |.~(lastbyte)+" F|
00000570  46 46 46 38 30 30 30 20  46 46 46 46 38 30 30 30  |FFF8000 FFFF8000|
00000580  22 0d 03 d4 11 58 25 3d  73 61 76 65 20 83 20 32  |"....X%=save . 2|
00000590  35 36 0d 03 de 11 59 25  3d 73 61 76 65 20 81 20  |56....Y%=save . |
000005a0  32 35 36 0d 03 e8 0b 2a  4f 50 54 31 2c 32 0d 03  |256....*OPT1,2..|
000005b0  f2 0b d6 20 6f 73 63 6c  69 0d 03 fc 0b 2a 4f 50  |... oscli....*OP|
000005c0  54 31 2c 30 0d 04 06 05  e0 0d 04 10 10 dd a4 65  |T1,0...........e|
000005d0  71 75 62 28 62 79 74 65  29 0d 04 1a 0c 3f 50 25  |qub(byte)....?P%|
000005e0  3d 62 79 74 65 0d 04 24  0b 50 25 3d 50 25 2b 31  |=byte..$.P%=P%+1|
000005f0  0d 04 2e 09 3d 70 61 73  73 0d 04 38 10 dd a4 65  |....=pass..8...e|
00000600  71 75 77 28 77 6f 72 64  29 0d 04 42 12 3f 50 25  |quw(word)..B.?P%|
00000610  3d 77 6f 72 64 20 83 20  32 35 36 0d 04 4c 13 50  |=word . 256..L.P|
00000620  25 3f 31 3d 77 6f 72 64  20 81 20 32 35 36 0d 04  |%?1=word . 256..|
00000630  56 0b 50 25 3d 50 25 2b  32 0d 04 60 09 3d 70 61  |V.P%=P%+2..`.=pa|
00000640  73 73 0d 04 6a 12 dd a4  65 71 75 64 28 64 6f 75  |ss..j...equd(dou|
00000650  62 6c 65 29 0d 04 74 0e  21 50 25 3d 64 6f 75 62  |ble)..t.!P%=doub|
00000660  6c 65 0d 04 7e 0b 50 25  3d 50 25 2b 34 0d 04 88  |le..~.P%=P%+4...|
00000670  09 3d 70 61 73 73 0d 04  92 13 dd a4 65 71 75 73  |.=pass......equs|
00000680  28 73 74 72 69 6e 67 24  29 0d 04 9c 0f 24 50 25  |(string$)....$P%|
00000690  3d 73 74 72 69 6e 67 24  0d 04 a6 14 50 25 3d 50  |=string$....P%=P|
000006a0  25 2b a9 28 73 74 72 69  6e 67 24 29 0d 04 b0 09  |%+.(string$)....|
000006b0  3d 70 61 73 73 0d ff                              |=pass..|
000006b7
21_11_87/CURSOR.m0
21_11_87/CURSOR.m1
21_11_87/CURSOR.m2
21_11_87/CURSOR.m4
21_11_87/CURSOR.m5