Home » CEEFAX disks » telesoftware10.adl » 16-10-88/REVERSE

16-10-88/REVERSE

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: 16-10-88/REVERSE
Read OK:
File size: 0836 bytes
Load address: 0800
Exec address: 8023
File contents
   10REM: REVERSE
   20MODE3
   30VDU14
   40ON ERROR GOTO 990
   50seventy=&70
   60osbyte=&FFF4
   70DIM mcode &100
   80DIM byte(11)
   90FORpass=0TO2STEP2
  100P%=mcode
  110[OPT pass
  120.read
  130LDA #&9F \ write to speech processor
  140LDY #&10 \ read byte command
  150JSR osbyte \ send read byte command
  160LDA #&9E \ read speech processor
  170JSR osbyte \ read byte at address register
  180TYA \ result into accumulator
  190RTS
  200.rotate
  210PHA
  220ROR A \ bit 0 into carry flag
  230PLA
  240ROR A \ rotate byte read from PHROM
  250RTS
  260.reverse
  270STA seventy \ store byte in &70
  280LDX #8 \ loop count = 8
  290.again
  300ROL seventy \ bit 7 of &70 into C
  310ROR A \ C into bit 7 of A
  320DEX \ decrement counter
  330BNE again \ if not 0 do it again
  340RTS
  350]
  360NEXT
  370INPUT"Start address &"start$
  380start=EVAL("&"+start$)
  390IF start > &3FFC THEN 370
  400INPUT"End address   &"end$
  410end=EVAL("&"+end$)
  420IF end > &3FFF THEN 400
  430A%=&9F :REM: write to speech processor
  440Y%=&40+(start AND &F) :REM: add Load Address command to least sig. nybble
  450CALL osbyte :REM: write least significant nybble with Load Address command
  460Y%=&40+(start AND &F0)DIV &10
  470CALL osbyte
  480Y%=&40+(start AND &F00)DIV &100
  490CALL osbyte
  500Y%=&4C+(start AND &F000)DIV &1000
  510CALL osbyte
  520Y%=&43 :REM: fifth byte always #&43
  530CALL osbyte
  540INPUT"Printer (Y/N) "yes$
  550IF LEFT$(yes$,1) ="Y" THEN VDU15,2
  560PRINT'"Addr";
  570PRINTTAB(7);"Untransformed";
  580PRINTTAB(28);"Rotated";
  590PRINTTAB(47);"Reversed"'
  600FOR block=start TO end STEP 4
  610IF block < &10 PRINT;"0";
  620IF block < &100 PRINT;"0";
  630IF block < &1000 PRINT;"0";
  640PRINT;~block;"   ";
  650FOR memory=0 TO 3
  660byte(memory)=USR(read)AND &FF
  670A%=byte(memory)
  680byte(memory+4)=USR(rotate)AND &FF
  690byte(memory+8)=USR(reverse)AND &FF
  700IF A%<16 VDU48
  710PRINT;~A%;" ";
  720NEXT
  730FOR memory=0 TO 3
  740A%=byte(memory)
  750IF A%>31 AND A%<127 VDUA% ELSE VDU46
  760NEXT
  770PRINT;"   ";
  780FOR memory=4 TO 7
  790A%=byte(memory)
  800IF A%<16 VDU48
  810PRINT;~A%;" ";
  820NEXT
  830FOR memory=4 TO 7
  840A%=byte(memory)
  850IF A%>31 AND A%<127 VDUA% ELSE VDU46
  860NEXT
  870PRINT;"   ";
  880FOR memory=8 TO 11
  890A%=byte(memory)
  900IF A%<16 VDU48
  910PRINT;~A%;" ";
  920NEXT
  930FOR memory=8 TO 11
  940A%=byte(memory)
  950IF A%>31 AND A%<127 VDUA% ELSE VDU46
  960NEXT
  970PRINT
  980NEXT
  990VDU3
 1000INPUT'"Another (Y/N) "yes$
 1010IF LEFT$(yes$,1)="Y" THEN RUN
 1020END

�: REVERSE
�3
�14
(� � � �d^C
2seventy=&70
<osbyte=&FFF4
F� mcode &100
P� byte(11)
Z�pass=0�2�2
dP%=mcode
n
[OPT pass
x	.read
�(LDA #&9F \ write to speech processor
� LDY #&10 \ read byte command
�'JSR osbyte \ send read byte command
�$LDA #&9E \ read speech processor
�.JSR osbyte \ read byte at address register
�!TYA \ result into accumulator
�RTS
�.rotate
�PHA
�!ROR A \ bit 0 into carry flag
�PLA
�'ROR A \ rotate byte read from PHROM
�RTS
.reverse
#STA seventy \ store byte in &70
LDX #8 \ loop count = 8
"
.again
,%ROL seventy \ bit 7 of &70 into C
6ROR A \ C into bit 7 of A
@DEX \ decrement counter
J$BNE again \ if not 0 do it again
TRTS
^]
h�
r�"Start address &"start$
|start=�("&"+start$)
�� start > &3FFC � �DrA
��"End address   &"end$
�end=�("&"+end$)
�� end > &3FFF � �tPA
�(A%=&9F :�: write to speech processor
�IY%=&40+(start � &F) :�: add Load Address command to least sig. nybble
�I� osbyte :�: write least significant nybble with Load Address command
�Y%=&40+(start � &F0)� &10
�� osbyte
�Y%=&40+(start � &F00)� &100
�� osbyte
�!Y%=&4C+(start � &F000)� &1000
�� osbyte
%Y%=&43 :�: fifth byte always #&43
� osbyte
�"Printer (Y/N) "yes$
&� �yes$,1) ="Y" � �15,2
0
�'"Addr";
:�7);"Untransformed";
D�28);"Rotated";
N�47);"Reversed"'
X� block=start � end � 4
b� block < &10 �;"0";
l� block < &100 �;"0";
v� block < &1000 �;"0";
��;~block;"   ";
�� memory=0 � 3
�byte(memory)=�(read)� &FF
�A%=byte(memory)
�!byte(memory+4)=�(rotate)� &FF
�"byte(memory+8)=�(reverse)� &FF
�� A%<16 �48
��;~A%;" ";
��
�� memory=0 � 3
�A%=byte(memory)
�� A%>31 � A%<127 �A% � �46
��
�;"   ";
� memory=4 � 7
A%=byte(memory)
 � A%<16 �48
*�;~A%;" ";
4�
>� memory=4 � 7
HA%=byte(memory)
R� A%>31 � A%<127 �A% � �46
\�
f�;"   ";
p� memory=8 � 11
zA%=byte(memory)
�� A%<16 �48
��;~A%;" ";
��
�� memory=8 � 11
�A%=byte(memory)
�� A%>31 � A%<127 �A% � �46
��
��
��
��3
��'"Another (Y/N) "yes$
�� �yes$,1)="Y" � �
��
�
00000000  0d 00 0a 0e f4 3a 20 52  45 56 45 52 53 45 0d 00  |.....: REVERSE..|
00000010  14 06 eb 33 0d 00 1e 07  ef 31 34 0d 00 28 0e ee  |...3.....14..(..|
00000020  20 85 20 e5 20 8d 64 5e  43 0d 00 32 0f 73 65 76  | . . .d^C..2.sev|
00000030  65 6e 74 79 3d 26 37 30  0d 00 3c 10 6f 73 62 79  |enty=&70..<.osby|
00000040  74 65 3d 26 46 46 46 34  0d 00 46 10 de 20 6d 63  |te=&FFF4..F.. mc|
00000050  6f 64 65 20 26 31 30 30  0d 00 50 0e de 20 62 79  |ode &100..P.. by|
00000060  74 65 28 31 31 29 0d 00  5a 0f e3 70 61 73 73 3d  |te(11)..Z..pass=|
00000070  30 b8 32 88 32 0d 00 64  0c 50 25 3d 6d 63 6f 64  |0.2.2..d.P%=mcod|
00000080  65 0d 00 6e 0d 5b 4f 50  54 20 70 61 73 73 0d 00  |e..n.[OPT pass..|
00000090  78 09 2e 72 65 61 64 0d  00 82 28 4c 44 41 20 23  |x..read...(LDA #|
000000a0  26 39 46 20 5c 20 77 72  69 74 65 20 74 6f 20 73  |&9F \ write to s|
000000b0  70 65 65 63 68 20 70 72  6f 63 65 73 73 6f 72 0d  |peech processor.|
000000c0  00 8c 20 4c 44 59 20 23  26 31 30 20 5c 20 72 65  |.. LDY #&10 \ re|
000000d0  61 64 20 62 79 74 65 20  63 6f 6d 6d 61 6e 64 0d  |ad byte command.|
000000e0  00 96 27 4a 53 52 20 6f  73 62 79 74 65 20 5c 20  |..'JSR osbyte \ |
000000f0  73 65 6e 64 20 72 65 61  64 20 62 79 74 65 20 63  |send read byte c|
00000100  6f 6d 6d 61 6e 64 0d 00  a0 24 4c 44 41 20 23 26  |ommand...$LDA #&|
00000110  39 45 20 5c 20 72 65 61  64 20 73 70 65 65 63 68  |9E \ read speech|
00000120  20 70 72 6f 63 65 73 73  6f 72 0d 00 aa 2e 4a 53  | processor....JS|
00000130  52 20 6f 73 62 79 74 65  20 5c 20 72 65 61 64 20  |R osbyte \ read |
00000140  62 79 74 65 20 61 74 20  61 64 64 72 65 73 73 20  |byte at address |
00000150  72 65 67 69 73 74 65 72  0d 00 b4 21 54 59 41 20  |register...!TYA |
00000160  5c 20 72 65 73 75 6c 74  20 69 6e 74 6f 20 61 63  |\ result into ac|
00000170  63 75 6d 75 6c 61 74 6f  72 0d 00 be 07 52 54 53  |cumulator....RTS|
00000180  0d 00 c8 0b 2e 72 6f 74  61 74 65 0d 00 d2 07 50  |.....rotate....P|
00000190  48 41 0d 00 dc 21 52 4f  52 20 41 20 5c 20 62 69  |HA...!ROR A \ bi|
000001a0  74 20 30 20 69 6e 74 6f  20 63 61 72 72 79 20 66  |t 0 into carry f|
000001b0  6c 61 67 0d 00 e6 07 50  4c 41 0d 00 f0 27 52 4f  |lag....PLA...'RO|
000001c0  52 20 41 20 5c 20 72 6f  74 61 74 65 20 62 79 74  |R A \ rotate byt|
000001d0  65 20 72 65 61 64 20 66  72 6f 6d 20 50 48 52 4f  |e read from PHRO|
000001e0  4d 0d 00 fa 07 52 54 53  0d 01 04 0c 2e 72 65 76  |M....RTS.....rev|
000001f0  65 72 73 65 0d 01 0e 23  53 54 41 20 73 65 76 65  |erse...#STA seve|
00000200  6e 74 79 20 5c 20 73 74  6f 72 65 20 62 79 74 65  |nty \ store byte|
00000210  20 69 6e 20 26 37 30 0d  01 18 1b 4c 44 58 20 23  | in &70....LDX #|
00000220  38 20 5c 20 6c 6f 6f 70  20 63 6f 75 6e 74 20 3d  |8 \ loop count =|
00000230  20 38 0d 01 22 0a 2e 61  67 61 69 6e 0d 01 2c 25  | 8.."..again..,%|
00000240  52 4f 4c 20 73 65 76 65  6e 74 79 20 5c 20 62 69  |ROL seventy \ bi|
00000250  74 20 37 20 6f 66 20 26  37 30 20 69 6e 74 6f 20  |t 7 of &70 into |
00000260  43 0d 01 36 1d 52 4f 52  20 41 20 5c 20 43 20 69  |C..6.ROR A \ C i|
00000270  6e 74 6f 20 62 69 74 20  37 20 6f 66 20 41 0d 01  |nto bit 7 of A..|
00000280  40 1b 44 45 58 20 5c 20  64 65 63 72 65 6d 65 6e  |@.DEX \ decremen|
00000290  74 20 63 6f 75 6e 74 65  72 0d 01 4a 24 42 4e 45  |t counter..J$BNE|
000002a0  20 61 67 61 69 6e 20 5c  20 69 66 20 6e 6f 74 20  | again \ if not |
000002b0  30 20 64 6f 20 69 74 20  61 67 61 69 6e 0d 01 54  |0 do it again..T|
000002c0  07 52 54 53 0d 01 5e 05  5d 0d 01 68 05 ed 0d 01  |.RTS..^.]..h....|
000002d0  72 1c e8 22 53 74 61 72  74 20 61 64 64 72 65 73  |r.."Start addres|
000002e0  73 20 26 22 73 74 61 72  74 24 0d 01 7c 17 73 74  |s &"start$..|.st|
000002f0  61 72 74 3d a0 28 22 26  22 2b 73 74 61 72 74 24  |art=.("&"+start$|
00000300  29 0d 01 86 1a e7 20 73  74 61 72 74 20 3e 20 26  |)..... start > &|
00000310  33 46 46 43 20 8c 20 8d  44 72 41 0d 01 90 1a e8  |3FFC . .DrA.....|
00000320  22 45 6e 64 20 61 64 64  72 65 73 73 20 20 20 26  |"End address   &|
00000330  22 65 6e 64 24 0d 01 9a  13 65 6e 64 3d a0 28 22  |"end$....end=.("|
00000340  26 22 2b 65 6e 64 24 29  0d 01 a4 18 e7 20 65 6e  |&"+end$)..... en|
00000350  64 20 3e 20 26 33 46 46  46 20 8c 20 8d 74 50 41  |d > &3FFF . .tPA|
00000360  0d 01 ae 28 41 25 3d 26  39 46 20 3a f4 3a 20 77  |...(A%=&9F :.: w|
00000370  72 69 74 65 20 74 6f 20  73 70 65 65 63 68 20 70  |rite to speech p|
00000380  72 6f 63 65 73 73 6f 72  0d 01 b8 49 59 25 3d 26  |rocessor...IY%=&|
00000390  34 30 2b 28 73 74 61 72  74 20 80 20 26 46 29 20  |40+(start . &F) |
000003a0  3a f4 3a 20 61 64 64 20  4c 6f 61 64 20 41 64 64  |:.: add Load Add|
000003b0  72 65 73 73 20 63 6f 6d  6d 61 6e 64 20 74 6f 20  |ress command to |
000003c0  6c 65 61 73 74 20 73 69  67 2e 20 6e 79 62 62 6c  |least sig. nybbl|
000003d0  65 0d 01 c2 49 d6 20 6f  73 62 79 74 65 20 3a f4  |e...I. osbyte :.|
000003e0  3a 20 77 72 69 74 65 20  6c 65 61 73 74 20 73 69  |: write least si|
000003f0  67 6e 69 66 69 63 61 6e  74 20 6e 79 62 62 6c 65  |gnificant nybble|
00000400  20 77 69 74 68 20 4c 6f  61 64 20 41 64 64 72 65  | with Load Addre|
00000410  73 73 20 63 6f 6d 6d 61  6e 64 0d 01 cc 1d 59 25  |ss command....Y%|
00000420  3d 26 34 30 2b 28 73 74  61 72 74 20 80 20 26 46  |=&40+(start . &F|
00000430  30 29 81 20 26 31 30 0d  01 d6 0c d6 20 6f 73 62  |0). &10..... osb|
00000440  79 74 65 0d 01 e0 1f 59  25 3d 26 34 30 2b 28 73  |yte....Y%=&40+(s|
00000450  74 61 72 74 20 80 20 26  46 30 30 29 81 20 26 31  |tart . &F00). &1|
00000460  30 30 0d 01 ea 0c d6 20  6f 73 62 79 74 65 0d 01  |00..... osbyte..|
00000470  f4 21 59 25 3d 26 34 43  2b 28 73 74 61 72 74 20  |.!Y%=&4C+(start |
00000480  80 20 26 46 30 30 30 29  81 20 26 31 30 30 30 0d  |. &F000). &1000.|
00000490  01 fe 0c d6 20 6f 73 62  79 74 65 0d 02 08 25 59  |.... osbyte...%Y|
000004a0  25 3d 26 34 33 20 3a f4  3a 20 66 69 66 74 68 20  |%=&43 :.: fifth |
000004b0  62 79 74 65 20 61 6c 77  61 79 73 20 23 26 34 33  |byte always #&43|
000004c0  0d 02 12 0c d6 20 6f 73  62 79 74 65 0d 02 1c 19  |..... osbyte....|
000004d0  e8 22 50 72 69 6e 74 65  72 20 28 59 2f 4e 29 20  |."Printer (Y/N) |
000004e0  22 79 65 73 24 0d 02 26  1b e7 20 c0 79 65 73 24  |"yes$..&.. .yes$|
000004f0  2c 31 29 20 3d 22 59 22  20 8c 20 ef 31 35 2c 32  |,1) ="Y" . .15,2|
00000500  0d 02 30 0d f1 27 22 41  64 64 72 22 3b 0d 02 3a  |..0..'"Addr";..:|
00000510  19 f1 8a 37 29 3b 22 55  6e 74 72 61 6e 73 66 6f  |...7);"Untransfo|
00000520  72 6d 65 64 22 3b 0d 02  44 14 f1 8a 32 38 29 3b  |rmed";..D...28);|
00000530  22 52 6f 74 61 74 65 64  22 3b 0d 02 4e 15 f1 8a  |"Rotated";..N...|
00000540  34 37 29 3b 22 52 65 76  65 72 73 65 64 22 27 0d  |47);"Reversed"'.|
00000550  02 58 1b e3 20 62 6c 6f  63 6b 3d 73 74 61 72 74  |.X.. block=start|
00000560  20 b8 20 65 6e 64 20 88  20 34 0d 02 62 18 e7 20  | . end . 4..b.. |
00000570  62 6c 6f 63 6b 20 3c 20  26 31 30 20 f1 3b 22 30  |block < &10 .;"0|
00000580  22 3b 0d 02 6c 19 e7 20  62 6c 6f 63 6b 20 3c 20  |";..l.. block < |
00000590  26 31 30 30 20 f1 3b 22  30 22 3b 0d 02 76 1a e7  |&100 .;"0";..v..|
000005a0  20 62 6c 6f 63 6b 20 3c  20 26 31 30 30 30 20 f1  | block < &1000 .|
000005b0  3b 22 30 22 3b 0d 02 80  13 f1 3b 7e 62 6c 6f 63  |;"0";.....;~bloc|
000005c0  6b 3b 22 20 20 20 22 3b  0d 02 8a 12 e3 20 6d 65  |k;"   ";..... me|
000005d0  6d 6f 72 79 3d 30 20 b8  20 33 0d 02 94 1d 62 79  |mory=0 . 3....by|
000005e0  74 65 28 6d 65 6d 6f 72  79 29 3d ba 28 72 65 61  |te(memory)=.(rea|
000005f0  64 29 80 20 26 46 46 0d  02 9e 13 41 25 3d 62 79  |d). &FF....A%=by|
00000600  74 65 28 6d 65 6d 6f 72  79 29 0d 02 a8 21 62 79  |te(memory)...!by|
00000610  74 65 28 6d 65 6d 6f 72  79 2b 34 29 3d ba 28 72  |te(memory+4)=.(r|
00000620  6f 74 61 74 65 29 80 20  26 46 46 0d 02 b2 22 62  |otate). &FF..."b|
00000630  79 74 65 28 6d 65 6d 6f  72 79 2b 38 29 3d ba 28  |yte(memory+8)=.(|
00000640  72 65 76 65 72 73 65 29  80 20 26 46 46 0d 02 bc  |reverse). &FF...|
00000650  0f e7 20 41 25 3c 31 36  20 ef 34 38 0d 02 c6 0e  |.. A%<16 .48....|
00000660  f1 3b 7e 41 25 3b 22 20  22 3b 0d 02 d0 05 ed 0d  |.;~A%;" ";......|
00000670  02 da 12 e3 20 6d 65 6d  6f 72 79 3d 30 20 b8 20  |.... memory=0 . |
00000680  33 0d 02 e4 13 41 25 3d  62 79 74 65 28 6d 65 6d  |3....A%=byte(mem|
00000690  6f 72 79 29 0d 02 ee 1e  e7 20 41 25 3e 33 31 20  |ory)..... A%>31 |
000006a0  80 20 41 25 3c 31 32 37  20 ef 41 25 20 8b 20 ef  |. A%<127 .A% . .|
000006b0  34 36 0d 02 f8 05 ed 0d  03 02 0c f1 3b 22 20 20  |46..........;"  |
000006c0  20 22 3b 0d 03 0c 12 e3  20 6d 65 6d 6f 72 79 3d  | ";..... memory=|
000006d0  34 20 b8 20 37 0d 03 16  13 41 25 3d 62 79 74 65  |4 . 7....A%=byte|
000006e0  28 6d 65 6d 6f 72 79 29  0d 03 20 0f e7 20 41 25  |(memory).. .. A%|
000006f0  3c 31 36 20 ef 34 38 0d  03 2a 0e f1 3b 7e 41 25  |<16 .48..*..;~A%|
00000700  3b 22 20 22 3b 0d 03 34  05 ed 0d 03 3e 12 e3 20  |;" ";..4....>.. |
00000710  6d 65 6d 6f 72 79 3d 34  20 b8 20 37 0d 03 48 13  |memory=4 . 7..H.|
00000720  41 25 3d 62 79 74 65 28  6d 65 6d 6f 72 79 29 0d  |A%=byte(memory).|
00000730  03 52 1e e7 20 41 25 3e  33 31 20 80 20 41 25 3c  |.R.. A%>31 . A%<|
00000740  31 32 37 20 ef 41 25 20  8b 20 ef 34 36 0d 03 5c  |127 .A% . .46..\|
00000750  05 ed 0d 03 66 0c f1 3b  22 20 20 20 22 3b 0d 03  |....f..;"   ";..|
00000760  70 13 e3 20 6d 65 6d 6f  72 79 3d 38 20 b8 20 31  |p.. memory=8 . 1|
00000770  31 0d 03 7a 13 41 25 3d  62 79 74 65 28 6d 65 6d  |1..z.A%=byte(mem|
00000780  6f 72 79 29 0d 03 84 0f  e7 20 41 25 3c 31 36 20  |ory)..... A%<16 |
00000790  ef 34 38 0d 03 8e 0e f1  3b 7e 41 25 3b 22 20 22  |.48.....;~A%;" "|
000007a0  3b 0d 03 98 05 ed 0d 03  a2 13 e3 20 6d 65 6d 6f  |;.......... memo|
000007b0  72 79 3d 38 20 b8 20 31  31 0d 03 ac 13 41 25 3d  |ry=8 . 11....A%=|
000007c0  62 79 74 65 28 6d 65 6d  6f 72 79 29 0d 03 b6 1e  |byte(memory)....|
000007d0  e7 20 41 25 3e 33 31 20  80 20 41 25 3c 31 32 37  |. A%>31 . A%<127|
000007e0  20 ef 41 25 20 8b 20 ef  34 36 0d 03 c0 05 ed 0d  | .A% . .46......|
000007f0  03 ca 05 f1 0d 03 d4 05  ed 0d 03 de 06 ef 33 0d  |..............3.|
00000800  03 e8 1a e8 27 22 41 6e  6f 74 68 65 72 20 28 59  |....'"Another (Y|
00000810  2f 4e 29 20 22 79 65 73  24 0d 03 f2 16 e7 20 c0  |/N) "yes$..... .|
00000820  79 65 73 24 2c 31 29 3d  22 59 22 20 8c 20 f9 0d  |yes$,1)="Y" . ..|
00000830  03 fc 05 e0 0d ff                                 |......|
00000836
16-10-88/REVERSE.m0
16-10-88/REVERSE.m1
16-10-88/REVERSE.m2
16-10-88/REVERSE.m4
16-10-88/REVERSE.m5