Home » CEEFAX disks » telesoftware10.adl » 25-10-88/BRANCH

25-10-88/BRANCH

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: 25-10-88/BRANCH
Read OK:
File size: 04B8 bytes
Load address: 0800
Exec address: 8023
File contents
   10REM: BRANCH
   20osbyte=&FFF4
   30DIM mcode &200
   40FORpass=0TO2STEP2
   50P%=mcode
   60[OPT pass
   70LDX #0
   80.loop
   90LDA data,X
  100BMI return
  110JSR branch
  120INX
  130BNE loop
  140.return
  150RTS
  160.data
  170EQUS "6+8-5=9"
  180EQUB &FF \ end of data byte
  190.branch
  200CMP #ASC(" ") \ ASCII 32
  210BCC return \ return if less than 32
  220CMP #ASC("~")+1 \ ASCII 128
  230BCS return \ return if greater than 127
  240ASL A \ multiply accumulator by 2
  250PHA \ temporary store for accumulator
  260AND #&F \ LS nybble for Load Address
  270ORA #&40 \ Load Address command
  280TAY \ command into Y register
  290LDA #&9F \ write to speech processor
  300JSR osbyte
  310PLA \ pull temporary store
  320AND #&F0 \ isolate next nybble
  330LSR A
  340LSR A
  350LSR A
  360LSR A
  370ORA #&40 \ Load Address command
  380TAY \ command into Y register
  390LDA #&9F \ write to speech processor
  400JSR osbyte
  410LDY #&40 \ third byte must be #&40
  420JSR osbyte
  430LDY #&4C \ fourth byte must be #&4C
  440JSR osbyte
  450LDY #&43 \ fifth byte must be #&43
  460JSR osbyte
  470LDA #&9F \ write to speech processor
  480LDY #&30 \ read and branch command
  490JSR osbyte \ send read byte command
  500LDY #&50 \ speak command
  510JMP osbyte \ speak the word and return
  520]
  530NEXT
  540CALL mcode


�: BRANCH
osbyte=&FFF4
� mcode &200
(�pass=0�2�2
2P%=mcode
<
[OPT pass
F
LDX #0
P	.loop
ZLDA data,X
dBMI return
nJSR branch
xINX
�BNE loop
�.return
�RTS
�	.data
�EQUS "6+8-5=9"
�EQUB &FF \ end of data byte
�.branch
�CMP #�(" ") \ �II 32
�'BCC return \ return if less than 32
�CMP #�("~")+1 \ �II 128
�+BCS return \ return if greater than 127
�%ASL A \ multiply accumulator by 2
�)PHA \ temporary store for accumulator
&� #&F \ LS nybble for Load Address
"�A #&40 \ Load Address command
!TAY \ command into Y register
"(LDA #&9F \ write to speech processor
,JSR osbyte
6PLA \ pull temporary store
@ � #&F0 \ isolate next nybble
J	LSR A
T	LSR A
^	LSR A
h	LSR A
r"�A #&40 \ Load Address command
|!TAY \ command into Y register
�(LDA #&9F \ write to speech processor
�JSR osbyte
�&LDY #&40 \ third byte must be #&40
�JSR osbyte
�'LDY #&4C \ fourth byte must be #&4C
�JSR osbyte
�&LDY #&43 \ fifth byte must be #&43
�JSR osbyte
�(LDA #&9F \ write to speech processor
�&LDY #&30 \ read and branch command
�'JSR osbyte \ send read byte command
�LDY #&50 \ speak command
�*JMP osbyte \ speak the word and return
]
�
� mcode
�
00000000  0d 00 0a 0d f4 3a 20 42  52 41 4e 43 48 0d 00 14  |.....: BRANCH...|
00000010  10 6f 73 62 79 74 65 3d  26 46 46 46 34 0d 00 1e  |.osbyte=&FFF4...|
00000020  10 de 20 6d 63 6f 64 65  20 26 32 30 30 0d 00 28  |.. mcode &200..(|
00000030  0f e3 70 61 73 73 3d 30  b8 32 88 32 0d 00 32 0c  |..pass=0.2.2..2.|
00000040  50 25 3d 6d 63 6f 64 65  0d 00 3c 0d 5b 4f 50 54  |P%=mcode..<.[OPT|
00000050  20 70 61 73 73 0d 00 46  0a 4c 44 58 20 23 30 0d  | pass..F.LDX #0.|
00000060  00 50 09 2e 6c 6f 6f 70  0d 00 5a 0e 4c 44 41 20  |.P..loop..Z.LDA |
00000070  64 61 74 61 2c 58 0d 00  64 0e 42 4d 49 20 72 65  |data,X..d.BMI re|
00000080  74 75 72 6e 0d 00 6e 0e  4a 53 52 20 62 72 61 6e  |turn..n.JSR bran|
00000090  63 68 0d 00 78 07 49 4e  58 0d 00 82 0c 42 4e 45  |ch..x.INX....BNE|
000000a0  20 6c 6f 6f 70 0d 00 8c  0b 2e 72 65 74 75 72 6e  | loop.....return|
000000b0  0d 00 96 07 52 54 53 0d  00 a0 09 2e 64 61 74 61  |....RTS.....data|
000000c0  0d 00 aa 12 45 51 55 53  20 22 36 2b 38 2d 35 3d  |....EQUS "6+8-5=|
000000d0  39 22 0d 00 b4 1f 45 51  55 42 20 26 46 46 20 5c  |9"....EQUB &FF \|
000000e0  20 65 6e 64 20 6f 66 20  64 61 74 61 20 62 79 74  | end of data byt|
000000f0  65 0d 00 be 0b 2e 62 72  61 6e 63 68 0d 00 c8 18  |e.....branch....|
00000100  43 4d 50 20 23 97 28 22  20 22 29 20 5c 20 97 49  |CMP #.(" ") \ .I|
00000110  49 20 33 32 0d 00 d2 27  42 43 43 20 72 65 74 75  |I 32...'BCC retu|
00000120  72 6e 20 5c 20 72 65 74  75 72 6e 20 69 66 20 6c  |rn \ return if l|
00000130  65 73 73 20 74 68 61 6e  20 33 32 0d 00 dc 1b 43  |ess than 32....C|
00000140  4d 50 20 23 97 28 22 7e  22 29 2b 31 20 5c 20 97  |MP #.("~")+1 \ .|
00000150  49 49 20 31 32 38 0d 00  e6 2b 42 43 53 20 72 65  |II 128...+BCS re|
00000160  74 75 72 6e 20 5c 20 72  65 74 75 72 6e 20 69 66  |turn \ return if|
00000170  20 67 72 65 61 74 65 72  20 74 68 61 6e 20 31 32  | greater than 12|
00000180  37 0d 00 f0 25 41 53 4c  20 41 20 5c 20 6d 75 6c  |7...%ASL A \ mul|
00000190  74 69 70 6c 79 20 61 63  63 75 6d 75 6c 61 74 6f  |tiply accumulato|
000001a0  72 20 62 79 20 32 0d 00  fa 29 50 48 41 20 5c 20  |r by 2...)PHA \ |
000001b0  74 65 6d 70 6f 72 61 72  79 20 73 74 6f 72 65 20  |temporary store |
000001c0  66 6f 72 20 61 63 63 75  6d 75 6c 61 74 6f 72 0d  |for accumulator.|
000001d0  01 04 26 80 20 23 26 46  20 5c 20 4c 53 20 6e 79  |..&. #&F \ LS ny|
000001e0  62 62 6c 65 20 66 6f 72  20 4c 6f 61 64 20 41 64  |bble for Load Ad|
000001f0  64 72 65 73 73 0d 01 0e  22 84 41 20 23 26 34 30  |dress...".A #&40|
00000200  20 5c 20 4c 6f 61 64 20  41 64 64 72 65 73 73 20  | \ Load Address |
00000210  63 6f 6d 6d 61 6e 64 0d  01 18 21 54 41 59 20 5c  |command...!TAY \|
00000220  20 63 6f 6d 6d 61 6e 64  20 69 6e 74 6f 20 59 20  | command into Y |
00000230  72 65 67 69 73 74 65 72  0d 01 22 28 4c 44 41 20  |register.."(LDA |
00000240  23 26 39 46 20 5c 20 77  72 69 74 65 20 74 6f 20  |#&9F \ write to |
00000250  73 70 65 65 63 68 20 70  72 6f 63 65 73 73 6f 72  |speech processor|
00000260  0d 01 2c 0e 4a 53 52 20  6f 73 62 79 74 65 0d 01  |..,.JSR osbyte..|
00000270  36 1e 50 4c 41 20 5c 20  70 75 6c 6c 20 74 65 6d  |6.PLA \ pull tem|
00000280  70 6f 72 61 72 79 20 73  74 6f 72 65 0d 01 40 20  |porary store..@ |
00000290  80 20 23 26 46 30 20 5c  20 69 73 6f 6c 61 74 65  |. #&F0 \ isolate|
000002a0  20 6e 65 78 74 20 6e 79  62 62 6c 65 0d 01 4a 09  | next nybble..J.|
000002b0  4c 53 52 20 41 0d 01 54  09 4c 53 52 20 41 0d 01  |LSR A..T.LSR A..|
000002c0  5e 09 4c 53 52 20 41 0d  01 68 09 4c 53 52 20 41  |^.LSR A..h.LSR A|
000002d0  0d 01 72 22 84 41 20 23  26 34 30 20 5c 20 4c 6f  |..r".A #&40 \ Lo|
000002e0  61 64 20 41 64 64 72 65  73 73 20 63 6f 6d 6d 61  |ad Address comma|
000002f0  6e 64 0d 01 7c 21 54 41  59 20 5c 20 63 6f 6d 6d  |nd..|!TAY \ comm|
00000300  61 6e 64 20 69 6e 74 6f  20 59 20 72 65 67 69 73  |and into Y regis|
00000310  74 65 72 0d 01 86 28 4c  44 41 20 23 26 39 46 20  |ter...(LDA #&9F |
00000320  5c 20 77 72 69 74 65 20  74 6f 20 73 70 65 65 63  |\ write to speec|
00000330  68 20 70 72 6f 63 65 73  73 6f 72 0d 01 90 0e 4a  |h processor....J|
00000340  53 52 20 6f 73 62 79 74  65 0d 01 9a 26 4c 44 59  |SR osbyte...&LDY|
00000350  20 23 26 34 30 20 5c 20  74 68 69 72 64 20 62 79  | #&40 \ third by|
00000360  74 65 20 6d 75 73 74 20  62 65 20 23 26 34 30 0d  |te must be #&40.|
00000370  01 a4 0e 4a 53 52 20 6f  73 62 79 74 65 0d 01 ae  |...JSR osbyte...|
00000380  27 4c 44 59 20 23 26 34  43 20 5c 20 66 6f 75 72  |'LDY #&4C \ four|
00000390  74 68 20 62 79 74 65 20  6d 75 73 74 20 62 65 20  |th byte must be |
000003a0  23 26 34 43 0d 01 b8 0e  4a 53 52 20 6f 73 62 79  |#&4C....JSR osby|
000003b0  74 65 0d 01 c2 26 4c 44  59 20 23 26 34 33 20 5c  |te...&LDY #&43 \|
000003c0  20 66 69 66 74 68 20 62  79 74 65 20 6d 75 73 74  | fifth byte must|
000003d0  20 62 65 20 23 26 34 33  0d 01 cc 0e 4a 53 52 20  | be #&43....JSR |
000003e0  6f 73 62 79 74 65 0d 01  d6 28 4c 44 41 20 23 26  |osbyte...(LDA #&|
000003f0  39 46 20 5c 20 77 72 69  74 65 20 74 6f 20 73 70  |9F \ write to sp|
00000400  65 65 63 68 20 70 72 6f  63 65 73 73 6f 72 0d 01  |eech processor..|
00000410  e0 26 4c 44 59 20 23 26  33 30 20 5c 20 72 65 61  |.&LDY #&30 \ rea|
00000420  64 20 61 6e 64 20 62 72  61 6e 63 68 20 63 6f 6d  |d and branch com|
00000430  6d 61 6e 64 0d 01 ea 27  4a 53 52 20 6f 73 62 79  |mand...'JSR osby|
00000440  74 65 20 5c 20 73 65 6e  64 20 72 65 61 64 20 62  |te \ send read b|
00000450  79 74 65 20 63 6f 6d 6d  61 6e 64 0d 01 f4 1c 4c  |yte command....L|
00000460  44 59 20 23 26 35 30 20  5c 20 73 70 65 61 6b 20  |DY #&50 \ speak |
00000470  63 6f 6d 6d 61 6e 64 0d  01 fe 2a 4a 4d 50 20 6f  |command...*JMP o|
00000480  73 62 79 74 65 20 5c 20  73 70 65 61 6b 20 74 68  |sbyte \ speak th|
00000490  65 20 77 6f 72 64 20 61  6e 64 20 72 65 74 75 72  |e word and retur|
000004a0  6e 0d 02 08 05 5d 0d 02  12 05 ed 0d 02 1c 0b d6  |n....]..........|
000004b0  20 6d 63 6f 64 65 0d ff                           | mcode..|
000004b8
25-10-88/BRANCH.m0
25-10-88/BRANCH.m1
25-10-88/BRANCH.m2
25-10-88/BRANCH.m4
25-10-88/BRANCH.m5