Home » CEEFAX disks » telesoftware10.adl » 18-11-88/TESTMOU

18-11-88/TESTMOU

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 » telesoftware10.adl
Filename: 18-11-88/TESTMOU
Read OK:
File size: 05F9 bytes
Load address: 0800
Exec address: 8023
File contents
   10REM> TESTMOU
   20DIM mcode &100 :REM: machine code at mcode
   30escape=&FF :REM: escape flag
   40drb=&FE60 :REM: data register B
   50ddrb=&FE62 :REM: data direction register B
   60ifr=&FE6D :REM: interrupt flag register
   70oswrch=&FFEE
   80osbyte=&FFF4
   90FOR pass=0 TO 2 STEP 2
  100P%=mcode
  110[OPT pass
  120LDA #&00
  130STA ddrb \ data register B = input
  140.mainloop
  150LDX #16
  160LDY #16
  170JSR vdu \ VDU 31,16,16
  180LDA drb \ data register B
  190JSR binary \ print DRB in binary
  200LDX #16
  210LDY #18
  220JSR vdu \ VDU 31,16,18
  230LDA ifr \ interrupt flag register
  240JSR binary \ print IFR in binary
  250LDA escape \ poll the escape flag
  260BPL mainloop \ loop if escape not pressed
  270LDA #&7E \ acknowledge detection of an Escape condition
  280JMP osbyte \ acknowledge Escape and return to BASIC
  290.binary
  300LDX #&08 \ bit counter
  310.nextbit
  320ASL A \ next bit into carry flag
  330PHA \ save the rest of the byte
  340LDA #ASC("0") \ if carry clear print 0
  350ADC #&00 \ if carry set add 1
  360JSR oswrch \ print 0 or 1
  370PLA \ restore the rest of the byte
  380DEX \ decrement bit counter
  390BNE nextbit \ branch for next bit
  400RTS
  410.vdu
  420LDA #31
  430JSR oswrch \ VDU 31
  440TXA
  450JSR oswrch \ VDU X
  460TYA
  470JMP oswrch \ VDU Y and return
  480]
  490NEXT
  500MODE7
  510VDU23,1,0;0;0;0;
  520mouse$=CHR$141+CHR$132+CHR$157+CHR$131+"User port input and status bytes  "+CHR$156
  530PRINTTAB(0,5)mouse$
  540PRINTTAB(0,6)mouse$
  550PRINTTAB(16,14)"76543210"
  560PRINTTAB(9,16)"&FE60 %         DRB"
  570PRINTTAB(9,18)"&FE6D %         IFR"
  580PRINTTAB(19,20)"CC"
  590PRINTTAB(19,21)"BB"
  600PRINTTAB(19,22)"12"
  610CALL mcode
  620VDU31,0,24
  630VDU23,1,1;0;0;0;
  640END

�> TESTMOU
*� mcode &100 :�: machine code at mcode
escape=&FF :�: escape flag
(!drb=&FE60 :�: data register B
2,ddrb=&FE62 :�: data direction register B
<)ifr=&FE6D :�: interrupt flag register
Foswrch=&FFEE
Posbyte=&FFF4
Z� pass=0 � 2 � 2
dP%=mcode
n
[OPT pass
xLDA #&00
�&STA ddrb \ data register B = input
�
.mainloop
�LDX #16
�LDY #16
�JSR vdu \ � 31,16,16
�LDA drb \ data register B
�$JSR binary \ print DRB in binary
�LDX #16
�LDY #18
�JSR vdu \ � 31,16,18
�%LDA ifr \ interrupt flag register
�#JSR binary \ print �R in binary
�%LDA escape \ poll the escape flag
-BPL mainloop \ loop if escape not pressed
;LDA #&7E \ acknowledge detection of an Escape condition
7JMP osbyte \ acknowledge Escape and return to BASIC
".binary
,LDX #&08 \ bit counter
6.nextbit
@$ASL A \ next bit into carry flag
J#PHA \ save the rest of the byte
T(LDA #�("0") \ if carry clear print 0
^!ADC #&00 \ if carry set add 1
hJSR oswrch \ print 0 or 1
r&PLA \ restore the rest of the byte
|DEX \ decrement bit counter
�%BNE nextbit \ branch for next bit
�RTS
�.vdu
�LDA #31
�JSR oswrch \ � 31
�TXA
�JSR oswrch \ � X
�TYA
�JMP oswrch \ � Y and return
�]
��
��7
��23,1,0;0;0;0;
Hmouse$=�141+�132+�157+�131+"User port input and status bytes  "+�156
�0,5)mouse$
�0,6)mouse$
&�16,14)"76543210"
0 �9,16)"&FE60 %         DRB"
: �9,18)"&FE6D %         IFR"
D�19,20)"CC"
N�19,21)"BB"
X�19,22)"12"
b� mcode
l�31,0,24
v�23,1,1;0;0;0;
��
�
00000000  0d 00 0a 0e f4 3e 20 54  45 53 54 4d 4f 55 0d 00  |.....> TESTMOU..|
00000010  14 2a de 20 6d 63 6f 64  65 20 26 31 30 30 20 3a  |.*. mcode &100 :|
00000020  f4 3a 20 6d 61 63 68 69  6e 65 20 63 6f 64 65 20  |.: machine code |
00000030  61 74 20 6d 63 6f 64 65  0d 00 1e 1e 65 73 63 61  |at mcode....esca|
00000040  70 65 3d 26 46 46 20 3a  f4 3a 20 65 73 63 61 70  |pe=&FF :.: escap|
00000050  65 20 66 6c 61 67 0d 00  28 21 64 72 62 3d 26 46  |e flag..(!drb=&F|
00000060  45 36 30 20 3a f4 3a 20  64 61 74 61 20 72 65 67  |E60 :.: data reg|
00000070  69 73 74 65 72 20 42 0d  00 32 2c 64 64 72 62 3d  |ister B..2,ddrb=|
00000080  26 46 45 36 32 20 3a f4  3a 20 64 61 74 61 20 64  |&FE62 :.: data d|
00000090  69 72 65 63 74 69 6f 6e  20 72 65 67 69 73 74 65  |irection registe|
000000a0  72 20 42 0d 00 3c 29 69  66 72 3d 26 46 45 36 44  |r B..<)ifr=&FE6D|
000000b0  20 3a f4 3a 20 69 6e 74  65 72 72 75 70 74 20 66  | :.: interrupt f|
000000c0  6c 61 67 20 72 65 67 69  73 74 65 72 0d 00 46 10  |lag register..F.|
000000d0  6f 73 77 72 63 68 3d 26  46 46 45 45 0d 00 50 10  |oswrch=&FFEE..P.|
000000e0  6f 73 62 79 74 65 3d 26  46 46 46 34 0d 00 5a 14  |osbyte=&FFF4..Z.|
000000f0  e3 20 70 61 73 73 3d 30  20 b8 20 32 20 88 20 32  |. pass=0 . 2 . 2|
00000100  0d 00 64 0c 50 25 3d 6d  63 6f 64 65 0d 00 6e 0d  |..d.P%=mcode..n.|
00000110  5b 4f 50 54 20 70 61 73  73 0d 00 78 0c 4c 44 41  |[OPT pass..x.LDA|
00000120  20 23 26 30 30 0d 00 82  26 53 54 41 20 64 64 72  | #&00...&STA ddr|
00000130  62 20 5c 20 64 61 74 61  20 72 65 67 69 73 74 65  |b \ data registe|
00000140  72 20 42 20 3d 20 69 6e  70 75 74 0d 00 8c 0d 2e  |r B = input.....|
00000150  6d 61 69 6e 6c 6f 6f 70  0d 00 96 0b 4c 44 58 20  |mainloop....LDX |
00000160  23 31 36 0d 00 a0 0b 4c  44 59 20 23 31 36 0d 00  |#16....LDY #16..|
00000170  aa 18 4a 53 52 20 76 64  75 20 5c 20 ef 20 33 31  |..JSR vdu \ . 31|
00000180  2c 31 36 2c 31 36 0d 00  b4 1d 4c 44 41 20 64 72  |,16,16....LDA dr|
00000190  62 20 5c 20 64 61 74 61  20 72 65 67 69 73 74 65  |b \ data registe|
000001a0  72 20 42 0d 00 be 24 4a  53 52 20 62 69 6e 61 72  |r B...$JSR binar|
000001b0  79 20 5c 20 70 72 69 6e  74 20 44 52 42 20 69 6e  |y \ print DRB in|
000001c0  20 62 69 6e 61 72 79 0d  00 c8 0b 4c 44 58 20 23  | binary....LDX #|
000001d0  31 36 0d 00 d2 0b 4c 44  59 20 23 31 38 0d 00 dc  |16....LDY #18...|
000001e0  18 4a 53 52 20 76 64 75  20 5c 20 ef 20 33 31 2c  |.JSR vdu \ . 31,|
000001f0  31 36 2c 31 38 0d 00 e6  25 4c 44 41 20 69 66 72  |16,18...%LDA ifr|
00000200  20 5c 20 69 6e 74 65 72  72 75 70 74 20 66 6c 61  | \ interrupt fla|
00000210  67 20 72 65 67 69 73 74  65 72 0d 00 f0 23 4a 53  |g register...#JS|
00000220  52 20 62 69 6e 61 72 79  20 5c 20 70 72 69 6e 74  |R binary \ print|
00000230  20 e7 52 20 69 6e 20 62  69 6e 61 72 79 0d 00 fa  | .R in binary...|
00000240  25 4c 44 41 20 65 73 63  61 70 65 20 5c 20 70 6f  |%LDA escape \ po|
00000250  6c 6c 20 74 68 65 20 65  73 63 61 70 65 20 66 6c  |ll the escape fl|
00000260  61 67 0d 01 04 2d 42 50  4c 20 6d 61 69 6e 6c 6f  |ag...-BPL mainlo|
00000270  6f 70 20 5c 20 6c 6f 6f  70 20 69 66 20 65 73 63  |op \ loop if esc|
00000280  61 70 65 20 6e 6f 74 20  70 72 65 73 73 65 64 0d  |ape not pressed.|
00000290  01 0e 3b 4c 44 41 20 23  26 37 45 20 5c 20 61 63  |..;LDA #&7E \ ac|
000002a0  6b 6e 6f 77 6c 65 64 67  65 20 64 65 74 65 63 74  |knowledge detect|
000002b0  69 6f 6e 20 6f 66 20 61  6e 20 45 73 63 61 70 65  |ion of an Escape|
000002c0  20 63 6f 6e 64 69 74 69  6f 6e 0d 01 18 37 4a 4d  | condition...7JM|
000002d0  50 20 6f 73 62 79 74 65  20 5c 20 61 63 6b 6e 6f  |P osbyte \ ackno|
000002e0  77 6c 65 64 67 65 20 45  73 63 61 70 65 20 61 6e  |wledge Escape an|
000002f0  64 20 72 65 74 75 72 6e  20 74 6f 20 42 41 53 49  |d return to BASI|
00000300  43 0d 01 22 0b 2e 62 69  6e 61 72 79 0d 01 2c 1a  |C.."..binary..,.|
00000310  4c 44 58 20 23 26 30 38  20 5c 20 62 69 74 20 63  |LDX #&08 \ bit c|
00000320  6f 75 6e 74 65 72 0d 01  36 0c 2e 6e 65 78 74 62  |ounter..6..nextb|
00000330  69 74 0d 01 40 24 41 53  4c 20 41 20 5c 20 6e 65  |it..@$ASL A \ ne|
00000340  78 74 20 62 69 74 20 69  6e 74 6f 20 63 61 72 72  |xt bit into carr|
00000350  79 20 66 6c 61 67 0d 01  4a 23 50 48 41 20 5c 20  |y flag..J#PHA \ |
00000360  73 61 76 65 20 74 68 65  20 72 65 73 74 20 6f 66  |save the rest of|
00000370  20 74 68 65 20 62 79 74  65 0d 01 54 28 4c 44 41  | the byte..T(LDA|
00000380  20 23 97 28 22 30 22 29  20 5c 20 69 66 20 63 61  | #.("0") \ if ca|
00000390  72 72 79 20 63 6c 65 61  72 20 70 72 69 6e 74 20  |rry clear print |
000003a0  30 0d 01 5e 21 41 44 43  20 23 26 30 30 20 5c 20  |0..^!ADC #&00 \ |
000003b0  69 66 20 63 61 72 72 79  20 73 65 74 20 61 64 64  |if carry set add|
000003c0  20 31 0d 01 68 1d 4a 53  52 20 6f 73 77 72 63 68  | 1..h.JSR oswrch|
000003d0  20 5c 20 70 72 69 6e 74  20 30 20 6f 72 20 31 0d  | \ print 0 or 1.|
000003e0  01 72 26 50 4c 41 20 5c  20 72 65 73 74 6f 72 65  |.r&PLA \ restore|
000003f0  20 74 68 65 20 72 65 73  74 20 6f 66 20 74 68 65  | the rest of the|
00000400  20 62 79 74 65 0d 01 7c  1f 44 45 58 20 5c 20 64  | byte..|.DEX \ d|
00000410  65 63 72 65 6d 65 6e 74  20 62 69 74 20 63 6f 75  |ecrement bit cou|
00000420  6e 74 65 72 0d 01 86 25  42 4e 45 20 6e 65 78 74  |nter...%BNE next|
00000430  62 69 74 20 5c 20 62 72  61 6e 63 68 20 66 6f 72  |bit \ branch for|
00000440  20 6e 65 78 74 20 62 69  74 0d 01 90 07 52 54 53  | next bit....RTS|
00000450  0d 01 9a 08 2e 76 64 75  0d 01 a4 0b 4c 44 41 20  |.....vdu....LDA |
00000460  23 33 31 0d 01 ae 15 4a  53 52 20 6f 73 77 72 63  |#31....JSR oswrc|
00000470  68 20 5c 20 ef 20 33 31  0d 01 b8 07 54 58 41 0d  |h \ . 31....TXA.|
00000480  01 c2 14 4a 53 52 20 6f  73 77 72 63 68 20 5c 20  |...JSR oswrch \ |
00000490  ef 20 58 0d 01 cc 07 54  59 41 0d 01 d6 1f 4a 4d  |. X....TYA....JM|
000004a0  50 20 6f 73 77 72 63 68  20 5c 20 ef 20 59 20 61  |P oswrch \ . Y a|
000004b0  6e 64 20 72 65 74 75 72  6e 0d 01 e0 05 5d 0d 01  |nd return....]..|
000004c0  ea 05 ed 0d 01 f4 06 eb  37 0d 01 fe 12 ef 32 33  |........7.....23|
000004d0  2c 31 2c 30 3b 30 3b 30  3b 30 3b 0d 02 08 48 6d  |,1,0;0;0;0;...Hm|
000004e0  6f 75 73 65 24 3d bd 31  34 31 2b bd 31 33 32 2b  |ouse$=.141+.132+|
000004f0  bd 31 35 37 2b bd 31 33  31 2b 22 55 73 65 72 20  |.157+.131+"User |
00000500  70 6f 72 74 20 69 6e 70  75 74 20 61 6e 64 20 73  |port input and s|
00000510  74 61 74 75 73 20 62 79  74 65 73 20 20 22 2b bd  |tatus bytes  "+.|
00000520  31 35 36 0d 02 12 10 f1  8a 30 2c 35 29 6d 6f 75  |156......0,5)mou|
00000530  73 65 24 0d 02 1c 10 f1  8a 30 2c 36 29 6d 6f 75  |se$......0,6)mou|
00000540  73 65 24 0d 02 26 16 f1  8a 31 36 2c 31 34 29 22  |se$..&...16,14)"|
00000550  37 36 35 34 33 32 31 30  22 0d 02 30 20 f1 8a 39  |76543210"..0 ..9|
00000560  2c 31 36 29 22 26 46 45  36 30 20 25 20 20 20 20  |,16)"&FE60 %    |
00000570  20 20 20 20 20 44 52 42  22 0d 02 3a 20 f1 8a 39  |     DRB"..: ..9|
00000580  2c 31 38 29 22 26 46 45  36 44 20 25 20 20 20 20  |,18)"&FE6D %    |
00000590  20 20 20 20 20 49 46 52  22 0d 02 44 10 f1 8a 31  |     IFR"..D...1|
000005a0  39 2c 32 30 29 22 43 43  22 0d 02 4e 10 f1 8a 31  |9,20)"CC"..N...1|
000005b0  39 2c 32 31 29 22 42 42  22 0d 02 58 10 f1 8a 31  |9,21)"BB"..X...1|
000005c0  39 2c 32 32 29 22 31 32  22 0d 02 62 0b d6 20 6d  |9,22)"12"..b.. m|
000005d0  63 6f 64 65 0d 02 6c 0c  ef 33 31 2c 30 2c 32 34  |code..l..31,0,24|
000005e0  0d 02 76 12 ef 32 33 2c  31 2c 31 3b 30 3b 30 3b  |..v..23,1,1;0;0;|
000005f0  30 3b 0d 02 80 05 e0 0d  ff                       |0;.......|
000005f9
18-11-88/TESTMOU.m0
18-11-88/TESTMOU.m1
18-11-88/TESTMOU.m2
18-11-88/TESTMOU.m4
18-11-88/TESTMOU.m5