0000- 14 .TF softy1.bin ; object file 0000- 15 ; 0000- 16 ; Registers 0000- 17 ; 0000- 18 ; Pointer Register 1 (P1) 0000- 19 ; Pointer Register 2 (P2) RAM pointer, set to $0700 to point at IC21 RAM 0000- 20 ; between $0700 and $07FF and with negative offsets 0000- 21 ; at IC21 I/O between $0620 and $06A4 0000- 22 ; Pointer Register 3 (P3) subroutine pointer 0000- 23 ; 0000- 24 ; Processor Input/Outputs 0000- 25 ; 0000- 26 ; Flag 0 cursor write 0000- 27 ; Flag 1 Programming socket Vpp pulse enable 0000- 28 ; Flag 2 disables keypad 0000- 29 ; SENSE-A 8154 Interrupt (not used ?) 0000- 30 ; SENSE-B Serial Input 0000- 31 ; SIN Serial Input 0000- 32 ; SOUT Serial Output 0000- 33 ; 0000- 34 ; 8154 I/O ($0680 to $06A4, mirrored at $0780 to $07A4)) 0000- 35 ; 0000- 36 ; (offset from P2: $0700) FFFFFFA0- 37 PORTA .EQ -$60 ; Port A Data Register (address $06A0) FFFFFFA1- 38 PORTB .EQ -$5F ; Port B Data Register (address $06A1) FFFFFFA2- 39 ODRA .EQ -$5E ; Port A Output Definition Register (address $06A2) FFFFFFA3- 40 ODRB .EQ -$5D ; Port B Output Definition Register (address $06A3) 0000- 41 ; Port A Set Bit 0 (address $0790) 0000- 42 ; Port A Set Bit 1 (address $0791) 0000- 43 ; Port A Set Bit 2 (address $0792) 0000- 44 ; Port A Set Bit 3 (address $0793) 0000- 45 ; Port A Set Bit 4 (address $0794) 0000- 46 ; Port A Set Bit 5 (address $0795) 0000- 47 ; Port A Set Bit 6 (address $0796) 0000- 48 ; Port A Set Bit 7 (address $0797) 0000- 49 ; 0000- 50 ; Port A: PA0 screen Page select (output) 0000- 51 ; PA1 screen EPROM (low) or RAM (high) select (output) 0000- 52 ; PA3 and PA4 not used, avaliable on edgeconnector 0000- 53 ; PA5 to PA7 keyboard column scan (outputs) 0000- 54 ; Port B: PB0 to PB7 keyboard row scan (inputs) PB7 not used, avaliable on edgeconnector 0000- 55 ; 0000- 56 ; 8154 RAM 'Working RAM' ($0700 to $077F) 0000- 57 scrtch .EQ 0 ; $0700 Scratchpad 0000- 58 ; ; $0701 0000- 59 ; 0000- 60 ; Status Line (top line of display) 0000- 61 ; (offsets from P2 $0700) 0070- 62 curpH .EQ $70 ; $0770 Cursor Pointer high byte (P1H) 0071- 63 curpL .EQ $71 ; $0771 Cursor Pointer low byte (P1L) 0072- 64 acurpH .EQ $72 ; $0772 Alternate Cursor high byte 0073- 65 acurpL .EQ $73 ; $0773 Alternate Cursor low byte 0074- 66 subpH .EQ $74 ; $0774 Subroutine Pointer high byte (P3H) 0075- 67 subpL .EQ $75 ; $0775 Subroutine Pointer low byte (P3L) 0076- 68 accum .EQ $76 ; $0776 Accumulator (A) 0077- 69 extreg .EQ $77 ; $0777 Extension Register (E) 0078- 70 streg .EQ $78 ; $0778 Status Register (SR) 0079- 71 ppword .EQ $79 ; $0779 Parallel Parity Word (not used) 007A- 72 matchb .EQ $7A ; $077A Matchbyte (highlighted) 007B- 73 keywrd .EQ $7B ; $077B Keyword 007C- 74 curspd .EQ $7C ; $077C Cursor Speed Counter 007D- 75 endarc .EQ $7D ; $077D End Around Carry (flags 1st/2nd digit of entered byte) 007E- 76 hexdif .EQ $7E ; $077E Hexadecimal Difference between cursors 007F- 77 prompt .EQ $7F ; $077F Prompt, Mode etc. 0000- 78 ; 0000- 79 .org $0000 0000- 80 ; Source file: softy1.asm *** Warning: Instruction starts at page boundary 81 NOP 0000-08 81 ( 5) NOP 0001- 82 ; Entry point on Reset 0001-C4 06 83 ( 10) LDI #$06 0003-36 84 ( 8) XPAH P2 0004-C4 70 85 ( 10) LDI #$70 0006-32 86 ( 8) XPAL P2 ; P2 = $0670 0007-CE 01 87 ( 18) L0007: ST @1(P2) ; (A = 0), clear $0670 to $06FF 0009-32 88 ( 8) XPAL P2 ; test P2L 000A-98 03 89 (9/11) JZ DONE ; exit loop if P2L zero 000C-32 90 ( 8) XPAL P2 ; restore P2L and A 000D-90 F8 91 ( 11) JMP L0007 ; and go round again 000F-C4 0C 92 ( 10) DONE: LDI #$0C ; cursor pointers high byte=$0C (P2=$0700 from here on) 0011-CA 70 93 ( 18) ST curpH(P2) 0013-CA 72 94 ( 18) ST acurpH(P2) 0015-C4 00 95 ( 10) LDI #$00 0017-CA A3 96 ( 18) ST ODRB(P2) ; set Port B to all inputs 0019-C4 FF 97 ( 10) LDI #$FF 001B-CA A2 98 ( 18) ST ODRA(P2) ; set Port A to all outputs 001D-C4 3E 99 ( 10) LDI #$3E 001F-CA 00 100 ( 18) ST 0(P2) ; $0700=$3E 0021-C2 70 101 ( 18) LD curpH(P2) ; copy cursor pointer to P1 0023-35 102 ( 8) XPAH P1 ; high byte 0024-C2 71 103 ( 18) LD curpL(P2) 0026-31 104 ( 8) XPAL P1 ; low byte 0027-C4 03 105 ( 10) SCANKEYP3: LDI #$03 ; setup subroutine call 0029-37 106 ( 8) XPAH P3 002A-C4 3A 107 ( 10) LDI #$3A 002C-33 108 ( 8) XPAL P3 ; P3=$033A 002D-3F 109 ( 7) SCANKEY: XPPC P3 ; call keyboard scan routine 002E-C2 7B 110 ( 18) LD keywrd(P2) ; retrieve Keyword 0030-1E 111 ( 5) RR ; rotate right 4-bits - swap nibble order 0031-1E 112 ( 5) RR 0032-1E 113 ( 5) RR 0033-1E 114 ( 5) RR 0034-01 115 ( 7) XAE ; E = Keyword (nibbles reversed) 0035-C4 01 116 ( 10) LDI #$01 0037-50 117 ( 6) ANE ; AND with E 0038-9C 16 118 (9/11) JNZ FUNCTION ; jump if bit 1 set ($Function) 003A-AA 7D 119 ( 22) ILD endarc(P2) ; increment End Around Carry, result in A 003C-D4 01 120 ( 10) ANI #$01 ; AND with $01 003E-98 05 121 (9/11) JZ DIGIT2 ; jump if bit 1 is clear (2nd digit of byte) 0040-01 122 ( 7) XAE ; retrieve E (Keyword with nibbles reversed) 0041-C9 00 123 ( 18) ST 0(P1) ; and store at cursor pointer location (1st digit of byte) 0043-90 E8 124 ( 11) JMP SCANKEY ; scan keyboard again 0045- 125 ; 0045-C2 78 126 ( 18) DIGIT2: LD streg(P2) ; load Status Line Status Register 0047-07 127 ( 6) CAS ; and transfer to SR 0048-C1 00 128 ( 18) LD 0(P1) ; load value at Cursor Pointer location 004A-DA 7B 129 ( 18) OR keywrd(P2) ; OR with Keyword (2nd digit of byte) 004C-CD 01 130 ( 18) ST @1(P1) ; put back and increment Cursor Pointer 004E-90 DD 131 ( 11) JMP SCANKEY ; scan keyboard again 0050- 132 ; 0050-C4 00 133 ( 10) FUNCTION: LDI #$00 ; A=0 0052-CA 7D 134 ( 18) ST endarc(P2) ; clear End Around Carry (reset to 1st digit for next time) 0054-C4 21 135 ( 10) LDI #$21 ; Ex Command ? 0056-60 136 ( 6) XRE 0057-9C 21 137 (9/11) JNZ L007A ; jump if not Ex 0059- 138 ; Ex Command ?? 0059-C5 FF 139 ( 18) LD @-1(P1) 005B-C2 74 140 ( 18) LD subpH(P2) ; transfer Subroutine Pointer to P3 005D-37 141 ( 8) XPAH P3 ; high byte 005E-C2 75 142 ( 18) LD subpL(P2) 0060-33 143 ( 8) XPAL P3 ; low byte 0061-C2 78 144 ( 18) LD streg(P2) ; load Status Line Status Register 0063-07 145 ( 6) CAS ; and transfer to SR 0064-C2 77 146 ( 18) LD extreg(P2) ; load Status Line Extension Register 0066-01 147 ( 7) XAE ; and transfer to E 0067-C2 76 148 ( 18) LD accum(P2) ; load Status Line Accumulator 0069-3D 149 ( 7) XPPC P1 ; call P1 ?? 006A-CA 76 150 ( 18) ST accum(P2) ; update Status Line Accumulator 006C-01 151 ( 7) XAE ; transfer E to A 006D-CA 77 152 ( 18) ST extreg(P2) ; update Status Line Extension Register 006F-06 153 ( 5) CSA ; transfer SR to A 0070-CA 78 154 ( 18) ST streg(P2) ; update Status Line Status Register 0072-33 155 ( 8) XPAL P3 ; update Status Line Subroutine Pointer 0073-CA 75 156 ( 18) ST subpL(P2) ; low byte 0075-37 157 ( 8) XPAH P3 0076-CA 74 158 ( 18) ST subpH(P2) ; high byte 0078-90 AD 159 ( 11) L0078: JMP SCANKEYP3 ; call keyboard scan routine (restoring P3) 007A- 160 ; 007A-C4 11 161 ( 10) L007A: LDI #$11 ; $FORWARD Command ? 007C-60 162 ( 6) XRE 007D-9C 07 163 (9/11) JNZ L0086 ; jump if not FORWARD 007F-07 164 ( 6) CAS ; clear SR 0080-C1 00 165 ( 18) LD 0(P1) ; clear Cursor at Cursor Pointer 0082-CD 01 166 ( 18) ST @1(P1) 0084-90 F2 167 ( 11) L0084: JMP L0078 ; jump to call keyboard scan routine (restoring P3) 0086- 168 ; 0086-C4 01 169 ( 10) L0086: LDI #$01 ; $FIX Command ? 0088-60 170 ( 6) XRE 0089-9C 0B 171 (9/11) JNZ L0096 ; jump if not FIX 008B-C2 78 172 ( 18) LD streg(P2) ; load Status Line Status Register 008D-07 173 ( 6) CAS ; and transfer to SR 008E-C1 00 174 ( 18) LD 0(P1) ; update Cursor at cursor pointer 0090-C9 00 175 ( 18) ST 0(P1) 0092-C5 FF 176 ( 18) LD @-1(P1) ; decrement cursor pointer 0094-90 EE 177 ( 11) JMP L0084 ; jump to call keyboard scan routine (restoring P3) 0096- 178 ; 0096-C4 FF 179 ( 10) L0096: LDI #$FF 0098-CA 7F 180 ( 18) ST prompt(P2) ; Mode Flag=$FF (Function pressed) 009A-3F 181 ( 7) XPPC P3 ; return from subroutine call (get Function) 009B-C2 7B 182 ( 18) LD keywrd(P2) ; retrieve Keyword 009D-98 06 183 (9/11) JZ EXIT ; if 0 Exit pressed 009F-01 184 ( 7) XAE ; transfer keyword to E 00A0-C4 13 185 ( 10) LDI #$13 ; $Function pressed again ? 00A2-60 186 ( 6) XRE 00A3-9C 1B 187 (9/11) JNZ CLEAR ; jump if not Function, otherwise clear Function state 00A5- 188 ; 00A5-C4 00 189 ( 10) EXIT: LDI 0 ; $EXIT Command 00A7-CA 7F 190 ( 18) ST prompt(P2) ; Mode Flag=0 00A9-07 191 ( 6) CAS ; copy to status 00AA-31 192 ( 8) XPAL P1 ; P1L=0 00AB-C4 0C 193 ( 10) LDI #$0C 00AD-35 194 ( 8) XPAH P1 ; P1=$0C00 (Working RAM) 00AE-C1 00 195 ( 18) CLRCUR: LD 0(P1) ; clear Cursor memory 00B0-CD 01 196 ( 18) ST @1(P1) 00B2-35 197 ( 8) XPAH P1 00B3-98 03 198 (9/11) JZ CURTP1 ; if zero copy Cursor Pointer to P1 00B5-35 199 ( 8) XPAH P1 00B6-90 F6 200 ( 11) JMP CLRCUR ; continue clearing cursor memory 00B8- 201 ; 00B8-C2 70 202 ( 18) CURTP1: LD curpH(P2) ; copy Cursor Pointer to P1 00BA-35 203 ( 8) XPAH P1 00BB-C2 71 204 ( 18) LD curpL(P2) 00BD-31 205 ( 8) XPAL P1 00BE-90 C4 206 ( 11) JMP L0084 ; jump to call keyboard scan routine (restoring P3) 00C0- 207 ; 00C0-C4 0F 208 ( 10) CLEAR: LDI #$0F ; $CLEAR Command ? 00C2-60 209 ( 6) XRE 00C3-9C 0A 210 (9/11) JNZ FIX ; jump if not CLEAR 00C5- 211 ; CLEAR - fills Working RAM with $FF from the Current Cursor 00C5-C4 FF 212 ( 10) DOCLR: LDI #$FF 00C7-CD 01 213 ( 18) ST @1(P1) ; write $FF to cursor pointer location, increment pointer 00C9-35 214 ( 8) XPAH P1 00CA-98 EC 215 (9/11) JZ CURTP1 ; finished ? 00CC-35 216 ( 8) XPAH P1 ; restore high byte 00CD-90 F6 217 ( 11) JMP DOCLR ; keep CLEARing 00CF- 218 ; 00CF-C4 01 219 ( 10) FIX: LDI #$01 ; $FIX Command ? 00D1-60 220 ( 6) XRE 00D2-9C 0A 221 (9/11) JNZ DEFINE ; jump if not FIX 00D4- 222 ; FIX - copies current Cursor Pointer (P1) to Alternate Cursor 00D4-35 223 ( 8) CPACUR: XPAH P1 ; copy high byte 00D5-CA 72 224 ( 18) ST acurpH(P2) 00D7-35 225 ( 8) XPAH P1 ; restore P1 00D8-31 226 ( 8) XPAL P1 00D9-CA 73 227 ( 18) ST acurpL(P2) ; and low byte 00DB-31 228 ( 8) XPAL P1 ; restore P1 00DC-90 C7 229 ( 11) L00DC: JMP EXIT ; jump to EXIT 00DE- 230 ; 00DE-C4 02 231 ( 10) DEFINE: LDI #$02 ; $DEFINE Command ? 00E0-60 232 ( 6) XRE 00E1-9C 06 233 (9/11) JNZ SHIFT ; jump if not DEFINE 00E3- 234 ; DEFINE - defines a block of data 00E3-C4 01 235 ( 10) LDI #$01 00E5-CA 78 236 ( 18) ST streg(P2) ; Status Line Status Register=1 (set Flag 0 - cursor write) 00E7-90 EB 237 ( 11) JMP CPACUR ; and copy cursor to Alternate Cursor 00E9- 238 ; 00E9-C4 03 239 ( 10) SHIFT: LDI #$03 ; $SHIFT Command ? 00EB-60 240 ( 6) XRE 00EC-9C 62 241 (9/11) JNZ STORE ; jump if not SHIFT 00EE- 242 ; SHIFT - moves a block of data 00EE-3F 243 ( 7) L00EE: XPPC P3 ; return from subroutine call 00EF-C2 7B 244 ( 18) LD keywrd(P2) ; retrieve Keyword 00F1-01 245 ( 7) XAE 00F2-C4 11 246 ( 10) LDI #$11 ; $FORWARD Command ? 00F4-60 247 ( 6) XRE 00F5-9C 22 248 (9/11) JNZ BACK ; jump if not FORWARD 00F7- 249 ; FORWARD - move cursor forward 00F7-AA 7E 250 ( 22) ILD hexdif(P2) ; increment Hex Difference 00F9-01 251 ( 7) XAE ; and put result in E 00FA-C1 80 252 ( 18) LD E(P1) ; load location 00FC-CA 7F 253 ( 18) ST prompt(P2) ; Mode Flag 00FE-C4 01 254 ( 10) L00FE: LDI #$01 0100-07 255 ( 6) CAS ; set Flag 0 (Cursor) 0101-BA 7E 256 ( 22) DLD hexdif(P2) ; decrement Hex Difference 0103-01 257 ( 7) XAE ; and transfer result to E 0104-C1 80 258 ( 18) LD E(P1) ; load location 0106-01 259 ( 7) XAE ; transfer to E 0107-F4 01 260 ( 11) ADI #$01 ; add 1 to A 0109-01 261 ( 7) XAE ; and transfer to E 010A-C9 80 262 ( 18) ST E(P1) ; set Cursor 010C-01 263 ( 7) XAE 010D-9C EF 264 (9/11) JNZ L00FE ; continue 010F-07 265 ( 6) CAS ; clear Flag 0 (Cursor) 0110-08 266 ( 5) NOP 0111-C2 7F 267 ( 18) LD prompt(P2) ; Mode Flag 0113-CD 01 268 ( 18) ST @1(P1) ; clear Cursor 0115-AA 73 269 ( 22) ILD acurpL(P2) 0117-90 D5 270 ( 11) JMP L00EE ; and return 0119- 271 ; 0119-C4 10 272 ( 10) BACK: LDI #$10 ; $BACK Command ? 011B-60 273 ( 6) XRE 011C-98 06 274 (9/11) JZ L0124 ; jump if BACK 011E-C4 00 275 ( 10) L011E: LDI #$00 ; A=0 0120-CA 78 276 ( 18) ST streg(P2) ; Status Line Status Register=0 (clear Flags) 0122-90 B8 277 ( 11) JMP L00DC 0124- 278 ; 0124- 279 ; BACK - move cursor backwards 0124-C1 FF 280 ( 18) L0124: LD -1(P1) 0126-CA 7F 281 ( 18) ST prompt(P2) 0128-AA 7E 282 ( 22) ILD hexdif(P2) ; increment Hex Difference 012A-C4 00 283 ( 10) LDI #$00 012C-01 284 ( 7) XAE ; E=0 012D-C4 01 285 ( 10) L012D: LDI #$01 012F-07 286 ( 6) CAS ; set Flag 0 (Cursor) and clear Carry 0130-C1 80 287 ( 18) LD E(P1) 0132-01 288 ( 7) XAE 0133-F4 FF 289 ( 11) ADI #$FF ; add $FF (-1) 0135-01 290 ( 7) XAE 0136-C9 80 291 ( 18) ST E(P1) 0138-02 292 ( 5) CCL ; clear carry 0139-01 293 ( 7) XAE 013A-F4 02 294 ( 11) ADI #$02 ; add 2 013C-01 295 ( 7) XAE 013D-C2 7E 296 ( 18) LD hexdif(P2) ; Hex Difference 013F-60 297 ( 6) XRE 0140-9C EB 298 (9/11) JNZ L012D 0142-07 299 ( 6) CAS ; clear Flag 0 (Cursor) 0143-BA 7E 300 ( 22) DLD hexdif(P2) 0145-01 301 ( 7) XAE 0146-C2 7F 302 ( 18) LD prompt(P2) ; Mode Flag 0148-C9 80 303 ( 18) ST E(P1) 014A-BA 73 304 ( 22) DLD acurpL(P2) ; Alternate Cursor Pointer low byte 014C-C5 FF 305 ( 18) LD @-1(P1) 014E-90 9E 306 ( 11) JMP L00EE ; and return 0150- 307 ; 0150-C4 04 308 ( 10) STORE: LDI #$04 ; $STORE Command 0152-60 309 ( 6) XRE 0153-9C 27 310 (9/11) JNZ SWAP ; jump if not STORE 0155- 311 ; STORE - lifts a defined block into the Scratchpad 0155-01 312 ( 7) XAE 0156-AA 7E 313 ( 22) ILD hexdif(P2) ; Hex Difference 0158-C1 80 314 ( 18) L0158: LD E(P1) 015A-01 315 ( 7) XAE 015B-02 316 ( 5) CCL ; clear carry 015C-F4 01 317 ( 11) ADI #$01 ; add 1 015E-01 318 ( 7) XAE 015F-CA 80 319 ( 18) ST E(P2) 0161-C2 7E 320 ( 18) LD hexdif(P2) ; Hex Difference 0163-60 321 ( 6) XRE 0164-9C F2 322 (9/11) JNZ L0158 0166-01 323 ( 7) XAE 0167-CA 6F 324 ( 18) ST $6F(P2) 0169-AA 7E 325 ( 22) ILD hexdif(P2) ; Hex Difference 016B-01 326 ( 7) XAE 016C-C4 90 327 ( 10) LDI #$90 016E-CA 80 328 ( 18) ST E(P2) 0170-AA 7E 329 ( 22) ILD hexdif(P2) ; Hex Difference 0172-01 330 ( 7) XAE 0173-C4 00 331 ( 10) LDI #$00 0175-07 332 ( 6) CAS ; clear all flags 0176-FA 7E 333 ( 20) CAD hexdif(P2) ; complement and add Hex Difference 0178-CA 80 334 ( 18) ST E(P2) 017A-90 A2 335 ( 11) L017A: JMP L011E 017C- 336 ; 017C-C4 0E 337 ( 10) SWAP: LDI #$0E ; $SWAP Command ? 017E-60 338 ( 6) XRE 017F-9C 10 339 (9/11) JNZ GOSUB ; jump if not SWAP 0181- 340 ; SWAP - swaps Current Cursor and Alternate Cursor 0181-C2 72 341 ( 18) LD acurpH(P2) ; copy Alternate Cursor to Current Cursor 0183-CA 70 342 ( 18) ST curpH(P2) 0185-C2 73 343 ( 18) LD acurpL(P2) 0187-CA 71 344 ( 18) ST curpL(P2) 0189-35 345 ( 8) XPAH P1 ; copy Current Cursor to Alternate Cursor 018A-CA 72 346 ( 18) ST acurpH(P2) 018C-31 347 ( 8) XPAL P1 018D-CA 73 348 ( 18) ST acurpL(P2) 018F-90 E9 349 ( 11) L018F: JMP L017A 0191- 350 ; 0191-C4 12 351 ( 10) GOSUB: LDI #$12 ; $GOSUB Command ? 0193-60 352 ( 6) XRE 0194-9C 03 353 (9/11) JNZ MATCH ; jump if not GOSUB 0196- 354 ; GOSUB - 0196-3E 355 ( 7) XPPC P2 ; call subroutine at Current Cursor location 0197-90 F6 356 ( 11) JMP L018F 0199- 357 ; 0199-C4 0D 358 ( 10) MATCH: LDI #$0D ; $MATCH Command ? 019B-60 359 ( 6) XRE 019C-9C 3A 360 (9/11) JNZ INSERT ; jump if not MATCH 019E- 361 ; MATCH - 019E-3F 362 ( 7) XPPC P3 ; return from subroutine 019F-C2 7B 363 ( 18) LD keywrd(P2) 01A1-1E 364 ( 5) RR ; rotate to lower nibble ? 01A2-1E 365 ( 5) RR 01A3-1E 366 ( 5) RR 01A4-1E 367 ( 5) RR 01A5-01 368 ( 7) XAE ; put result in E 01A6-C4 01 369 ( 10) LDI #$01 01A8-50 370 ( 6) ANE ; AND with E 01A9-9C CE 371 (9/11) L01A9: JNZ $0179 ; jump to the middle of an instruction ? 01AB-01 372 ( 7) XAE 01AC-CA 7A 373 ( 18) ST matchb(P2) ; save value to Matchbyte 01AE-3F 374 ( 7) XPPC P3 ; return from subroutine 01AF-C2 7B 375 ( 18) LD keywrd(P2) 01B1-01 376 ( 7) XAE ; E=Keyword 01B2-C4 10 377 ( 10) LDI #$10 01B4-50 378 ( 6) ANE ; AND with $10 01B5-9C F2 379 (9/11) JNZ L01A9 ; jump if bit set 01B7-C2 7A 380 ( 18) LD matchb(P2) 01B9-58 381 ( 6) ORE ; OR with E 01BA-CA 7A 382 ( 18) ST matchb(P2) 01BC-01 383 ( 7) XAE 01BD-C4 0C 384 ( 10) LDI #$0C 01BF-35 385 ( 8) XPAH P1 01C0-C4 00 386 ( 10) LDI #$00 01C2-31 387 ( 8) XPAL P1 ; P1=$0C00 (Working RAM) 01C3-C5 01 388 ( 18) DOMATCH: LD @1(P1) 01C5-60 389 ( 6) XRE ; compare with E (Matchbyte) 01C6-9C 0A 390 (9/11) JNZ NOMATCH ; jump if no match 01C8-C4 01 391 ( 10) LDI #$01 ; a match 01CA-07 392 ( 6) CAS ; set Flag 0 (Cursor) 01CB-C1 FF 393 ( 18) LD -1(P1) ; set cursor at that location 01CD-C9 FF 394 ( 18) ST -1(P1) 01CF-C4 00 395 ( 10) LDI #$00 01D1-07 396 ( 6) CAS ; clear all flags 01D2-35 397 ( 8) NOMATCH: XPAH P1 01D3-98 68 398 (9/11) JZ L023D ; finished ? 01D5-35 399 ( 8) XPAH P1 01D6-90 EB 400 ( 11) JMP DOMATCH ; continue looking for a match 01D8- 401 ; 01D8-C4 05 402 ( 10) INSERT: LDI #$05 ; $INSERT Command ? 01DA-60 403 ( 6) XRE 01DB-9C 18 404 (9/11) JNZ COPY ; jump if not INSERT 01DD- 405 ; INSERT - writes the block in Scratchpad back to the 01DD- 406 ; current cursor location 01DD-01 407 ( 7) XAE ; E=0 (A=0) 01DE-C2 6F 408 ( 18) DOINSERT: LD $6F(P2) ; byte before curpH ? 01E0-60 409 ( 6) XRE 01E1-98 0B 410 (9/11) JZ L01EE ; jump if result zero 01E3-01 411 ( 7) XAE 01E4-02 412 ( 5) CCL ; clear carry 01E5-F4 01 413 ( 11) ADI #$01 ; add 1 01E7-01 414 ( 7) XAE ; put result in E 01E8-C2 80 415 ( 18) LD E(P2) 01EA-CD 01 416 ( 18) ST @1(P1) ; store at cursor pointer location and increment 01EC-90 F0 417 ( 11) JMP DOINSERT ; keep going 01EE- 418 ; 01EE-C4 26 419 ( 10) L01EE: LDI #$26 ; setup subroutine call 01F0-33 420 ( 8) XPAL P3 01F1-C4 00 421 ( 10) LDI #$00 01F3-37 422 ( 8) XPAH P3 ; P3=$0026 01F4-3F 423 ( 7) XPPC P3 ; call keyboard scan routine SCANKEYP3 01F5- 424 ; 01F5-C4 0C 425 ( 10) COPY: LDI #$0C 01F7-35 426 ( 8) XPAH P1 01F8-C4 00 427 ( 10) LDI #$00 01FA-31 428 ( 8) XPAL P1 ; P1=$0C00 (Working RAM) 01FB-C4 00 429 ( 10) LDI #$00 01FD-33 430 ( 8) XPAL P3 ; P3=$xx00 01FE-C4 0C 431 ( 10) LDI #$0C ; $COPY Command ? 0200-60 432 ( 6) XRE 0201-9C 0D 433 (9/11) JNZ COMP ; jump if not COPY 0203- 434 ; COPY - copies the contents of an EPROM in the Programming Socket 0203- 435 ; to Working RAM (screen) 0203-C4 08 436 ( 10) LDI #$08 0205-37 437 ( 8) XPAH P3 ; P3=$0800 Programming Socket 0206-C7 01 438 ( 18) DOCOPY: LD @1(P3) ; copy Programming Socket to Working RAM ($0C00) 0208-CD 01 439 ( 18) ST @1(P1) 020A-35 440 ( 8) XPAH P1 020B-98 08 441 (9/11) JZ VERIFY ; finished ? 020D-35 442 ( 8) XPAH P1 020E-90 F6 443 ( 11) JMP DOCOPY ; continue COPYing 0210- 444 ; 0210-C4 0A 445 ( 10) COMP: LDI #$0A ; $COMP Command ? 0212-60 446 ( 6) XRE 0213-9C 2F 447 (9/11) JNZ BURN ; jump if not COMP 0215- 448 ; COMP - compares the contents of an EPROM in the 0215- 449 ; Programming Socket with Working RAM (screen) 0215-CA 7F 450 ( 18) VERIFY: ST prompt(P2) ; Prompt=0 0217-C4 0C 451 ( 10) LDI #$0C 0219-35 452 ( 8) XPAH P1 021A-C4 00 453 ( 10) LDI #$00 021C-31 454 ( 8) XPAL P1 ; P1=$0C00 (Working RAM) 021D-C4 08 455 ( 10) LDI #$08 021F-37 456 ( 8) XPAH P3 0220-C4 00 457 ( 10) LDI #$00 0222-33 458 ( 8) XPAL P3 ; P3=$0800 Programming Socket 0223-C7 01 459 ( 18) DOCOMP: LD @1(P3) ; compare Programming Socket and Working RAM 0225-E5 01 460 ( 18) XOR @1(P1) 0227-9C 06 461 (9/11) JNZ DIFF ; jump if different 0229-35 462 ( 8) CNTCOMP: XPAH P1 022A-98 11 463 (9/11) JZ L023D ; finished ? 022C-35 464 ( 8) XPAH P1 022D-90 F4 465 ( 11) JMP DOCOMP ; continue COMParing 022F- 466 ; 022F-C4 01 467 ( 10) DIFF: LDI #$01 ; difference found 0231-07 468 ( 6) CAS ; set Flag 0 (Cursor) 0232-C1 FF 469 ( 18) LD -1(P1) ; mark the difference 0234-C9 FF 470 ( 18) ST -1(P1) 0236-C4 00 471 ( 10) LDI #$00 0238-07 472 ( 6) CAS ; clear all flags 0239-AA 7F 473 ( 22) ILD prompt(P2) ; increment Mode Flag as a count of differences found 023B-90 EC 474 ( 11) JMP CNTCOMP ; continue COMParing 023D- 475 ; 023D-C4 20 476 ( 10) L023D: LDI #$20 ; setup subroutine call 023F-33 477 ( 8) XPAL P3 0240-C4 00 478 ( 10) LDI #$00 0242-37 479 ( 8) XPAH P3 ; P3=$0020 0243-3F 480 ( 7) XPPC P3 ; call routine at $0021 0244- 481 ; 0244-C4 0B 482 ( 10) BURN: LDI #$0B ; $BURN Command ? 0246-60 483 ( 6) XRE 0247-9C 28 484 (9/11) JNZ RECORD ; jump if not BURN 0249- 485 ; BURN - Program EPROM in Programming Socket from Working RAM 0249-C4 00 486 ( 10) LDI #$00 ; A=0 024B-CA 7F 487 ( 18) L024B: ST prompt(P2) ; Prompt=0 024D-8F FF 488 ( 13+) DLY #$FF ; delay 130mS (13+2*0+514*255)uS 024F-8F FF 489 ( 13+) DLY #$FF ; delay 130mS (13+2*255+514*255)uS 0251-C4 02 490 ( 10) LDI #$02 0253-07 491 ( 6) CAS ; set Flag 1 (Programming Socket Vpp enable) 0254-C4 08 492 ( 10) LDI #$08 0256-37 493 ( 8) XPAH P3 ; P3=$0800 (Programming Socket) 0257-C4 0C 494 ( 10) LDI #$0C 0259-35 495 ( 8) XPAH P1 ; P1=$0C00 (Working RAM) 025A-C5 01 496 ( 18) DOBURN: LD @1(P1) ; read Working RAM and increment P1 025C-CF 00 497 ( 18) ST @0(P3) ; write to Programming Socket 025E-C7 01 498 ( 18) LD @1(P3) ; read back from Programming Socket and increment P3 0260-35 499 ( 8) XPAH P1 0261-98 03 500 (9/11) JZ L0266 ; finished ? 0263-35 501 ( 8) XPAH P1 0264-90 F4 502 ( 11) JMP DOBURN ; continue BURNing 0266- 503 ; 0266-07 504 ( 6) L0266: CAS 0267-8F FF 505 ( 13+) DLY #$FF ; delay 130mS (13+2*0+514*255)uS 0269-C2 7F 506 ( 18) LD prompt(P2) 026B-EC 01 507 ( 15) DAI #$01 ; decimal add 1 026D-9C DC 508 (9/11) JNZ L024B ; finished ? 026F-90 A4 509 ( 11) JMP VERIFY ; yes - jump to COMP command to verify 0271- 510 ; 0271-C4 07 511 ( 10) RECORD: LDI #$07 ; $RECORD Command ? 0273-60 512 ( 6) XRE 0274-9C 54 513 (9/11) JNZ RECALL ; jump if not RECORD 0276- 514 ; RECORD - transmits the contents of Working RAM in serial form 0276-C4 E1 515 ( 10) LDI #$E1 0278-33 516 ( 8) XPAL P3 ; P3=$03E1 0279-C4 20 517 ( 10) LDI #$20 027B-CA 7F 518 ( 18) ST prompt(P2) ; Mode Flag=$20 027D-C4 AA 519 ( 10) LDI #$AA 027F-CA 7E 520 ( 18) ST hexdif(P2) ; Hex Difference=$AA 0281-C2 7F 521 ( 18) L0281: LD prompt(P2) 0283-98 0C 522 (9/11) JZ L0291 ; finished ? 0285-C4 AA 523 ( 10) LDI #$AA 0287-01 524 ( 7) XAE ; E=$AA 0288-BA 7F 525 ( 22) DLD prompt(P2) ; decrement and load Mode Flag 028A-9C 03 526 (9/11) JNZ L028F ; return 028C-C4 69 527 ( 10) LDI #$69 028E-01 528 ( 7) XAE ; E=$69 028F-90 08 529 ( 11) L028F: JMP L0299 ; return 0291- 530 ; 0291-C5 01 531 ( 18) L0291: LD @1(P1) 0293-01 532 ( 7) XAE 0294-C2 7E 533 ( 18) LD hexdif(P2) 0296-60 534 ( 6) XRE 0297-CA 7E 535 ( 18) ST hexdif(P2) 0299-3F 536 ( 7) L0299: XPPC P3 ; return from subroutine 029A-8F 00 537 ( 13+) DLY #$00 029C-3F 538 ( 7) XPPC P3 ; return from subroutine 029D-8F 00 539 ( 13+) DLY #$00 029F-3F 540 ( 7) XPPC P3 ; return from subroutine 02A0-8F 00 541 ( 13+) DLY #$00 02A2-3F 542 ( 7) XPPC P3 ; return from subroutine 02A3-8F 00 543 ( 13+) DLY #$00 02A5-3F 544 ( 7) XPPC P3 ; return from subroutine 02A6-8F 00 545 ( 13+) DLY #$00 02A8-3F 546 ( 7) XPPC P3 ; return from subroutine 02A9-8F 00 547 ( 13+) DLY #$00 02AB-3F 548 ( 7) XPPC P3 ; return from subroutine 02AC-8F 00 549 ( 13+) DLY #$00 02AE-3F 550 ( 7) XPPC P3 ; return from subroutine 02AF-35 551 ( 8) XPAH P1 02B0-98 03 552 (9/11) JZ L02B5 02B2-35 553 ( 8) XPAH P1 02B3-90 CC 554 ( 11) JMP L0281 02B5- 555 ; 02B5-35 556 ( 8) L02B5: XPAH P1 02B6-C2 7F 557 ( 18) LD prompt(P2) 02B8-9C 09 558 (9/11) JNZ L02C3 02BA-C4 AA 559 ( 10) LDI #$AA 02BC-CA 7F 560 ( 18) ST prompt(P2) ; Mode Flag=$AA 02BE-C2 7E 561 ( 18) LD hexdif(P2) 02C0-01 562 ( 7) XAE 02C1-90 D6 563 ( 11) JMP L0299 02C3- 564 ; 02C3-C4 20 565 ( 10) L02C3: LDI #$20 ; setup subroutine call 02C5-33 566 ( 8) XPAL P3 02C6-C4 00 567 ( 10) LDI #$00 02C8-37 568 ( 8) XPAH P3 ; P3=$0020 02C9-3F 569 ( 7) XPPC P3 ; call routine at $0021 02CA- 570 ; 02CA-C4 08 571 ( 10) RECALL: LDI #$08 ; $RECALL Command ? 02CC-60 572 ( 6) XRE 02CD-9C 44 573 (9/11) JNZ RUN ; jump if not RECALL 02CF- 574 ; RECALL - reads serial input into Working RAM 02CF-C4 CE 575 ( 10) LDI #$CE 02D1-33 576 ( 8) XPAL P3 ; P3=$03CE 02D2-C4 30 577 ( 10) L02D2: LDI #$30 02D4-CA 7F 578 ( 18) ST prompt(P2) ; Mode Flag=$30 02D6-3F 579 ( 7) L02D6: XPPC P3 ; return from subroutine call 02D7-C4 AA 580 ( 10) LDI #$AA 02D9-60 581 ( 6) XRE ; E=$AA 02DA-98 05 582 (9/11) JZ L02E1 02DC-C4 55 583 ( 10) LDI #$55 02DE-60 584 ( 6) XRE ; E=$55 02DF-9C F1 585 (9/11) JNZ L02D2 02E1-BA 7F 586 ( 22) L02E1: DLD prompt(P2) 02E3-9C F1 587 (9/11) JNZ L02D6 02E5-3F 588 ( 7) L02E5: XPPC P3 ; return from subroutine call 02E6-C4 69 589 ( 10) LDI #$69 02E8-60 590 ( 6) XRE ; E=$69 02E9-9C FA 591 (9/11) JNZ L02E5 02EB-3F 592 ( 7) L02EB: XPPC P3 02EC-3F 593 ( 7) XPPC P3 02ED-3F 594 ( 7) XPPC P3 02EE-3F 595 ( 7) XPPC P3 02EF-3F 596 ( 7) XPPC P3 02F0-3F 597 ( 7) XPPC P3 02F1-3F 598 ( 7) XPPC P3 02F2-3F 599 ( 7) XPPC P3 02F3-CD 01 600 ( 18) ST @1(P1) 02F5-35 601 ( 8) XPAH 1 02F6-98 03 602 (9/11) JZ L02FB 02F8-35 603 ( 8) XPAH P1 02F9-90 F0 604 ( 11) JMP L02EB 02FB- 605 ; 02FB-C4 0C 606 ( 10) L02FB: LDI #$0C 02FD-35 607 ( 8) XPAH P1 ; P1H=$0C 02FE-3F 608 ( 7) XPPC P3 02FF-3F 609 ( 7) XPPC P3 0300-3F 610 ( 7) XPPC P3 0301-3F 611 ( 7) XPPC P3 0302-3F 612 ( 7) XPPC P3 0303-3F 613 ( 7) XPPC P3 0304-3F 614 ( 7) XPPC P3 0305-3F 615 ( 7) XPPC P3 0306-E5 01 616 ( 18) L0306: XOR @1(P1) 0308-35 617 ( 8) XPAH P1 0309-98 03 618 (9/11) JZ L030E 030B-35 619 ( 8) XPAH P1 030C-90 F8 620 ( 11) JMP L0306 030E- 621 ; 030E-35 622 ( 8) L030E: XPAH P1 030F-CA 7F 623 ( 18) ST prompt(P2) 0311-90 B0 624 ( 11) L0311: JMP L02C3 0313- 625 ; 0313-C4 06 626 ( 10) RUN: LDI #$06 ; $RUN Command ? 0315-60 627 ( 6) XRE 0316-9C 07 628 (9/11) JNZ FIRM ; jump if not RUN 0318- 629 ; RUN - hand control to a user program in the Programming Socket 0318-C4 08 630 ( 10) LDI #$08 031A-37 631 ( 8) XPAH P3 031B-C4 00 632 ( 10) LDI #$00 031D-33 633 ( 8) XPAL P3 ; P3=$0800 (Programming Socket) 031E-3F 634 ( 7) XPPC P3 ; call routine at $0801 in Programming socket 031F- 635 ; 031F-C4 09 636 ( 10) FIRM: LDI #$09 ; $FIRM ? 0321-60 637 ( 6) XRE 0322-9C ED 638 (9/11) JNZ L0311 ; jump if not FIRM 0324- 639 ; FIRM - copy contents of Softy 1 Firmware EPROM to Working RAM 0324-C4 00 640 ( 10) LDI #$00 0326-31 641 ( 8) XPAL P1 0327-C4 00 642 ( 10) LDI #$00 0329-33 643 ( 8) XPAL P3 032A-C4 00 644 ( 10) LDI #$00 032C-37 645 ( 8) XPAH P3 ; P3=$0000 (Firmware EPROM) 032D-C4 0C 646 ( 10) LDI #$0C 032F-35 647 ( 8) XPAH P1 ; P1=$0C00 (Working RAM) 0330-C7 01 648 ( 18) DOFIRM: LD @1(P3) ; copy Firmware EPROM to Working RAM 0332-CD 01 649 ( 18) ST @1(P1) 0334-35 650 ( 8) XPAH P1 0335-98 DA 651 (9/11) JZ L0311 ; finished ? (reached $0000) 0337-35 652 ( 8) XPAH P1 0338-90 F6 653 ( 11) JMP DOFIRM ; continue copying 033A- 654 ; 033A-3F 655 ( 7) L033A: XPPC P3 ; return from subroutine call 033B- 656 ; 033B- 657 ; Scan Keyboard Routine 033B-35 658 ( 8) KEYSCAN: XPAH P1 ; P1 is a copy of the cursor pointer 033C-CA 70 659 ( 18) ST curpH(P2) ; save the high byte 033E-35 660 ( 8) XPAH P1 ; and restore P1 033F-C2 70 661 ( 18) LD curpH(P2) 0341-1C 662 ( 5) SR ; shift 1 bit right to provide screen Page,RAM/EPROM selects 0342-CA A0 663 ( 18) ST PORTA(P2) ; write screen Page,RAM/EPROM selects and clear keyboard Row 0344-C4 81 664 ( 10) LDI #$81 0346-07 665 ( 6) CAS ; set Flag 0 (Cursor) and Carry 0347-31 666 ( 8) XPAL P1 ; A=P1 low byte 0348-CA 71 667 ( 18) ST curpL(P2) ; save as Cursor Pointer low byte 034A-01 668 ( 7) XAE ; E=Cursor Pointer low byte 034B-C2 73 669 ( 18) LD acurpL(P2) ; A=Alternate Cursor Pointer low byte 034D-78 670 ( 8) CAE ; calculate the difference 034E-CA 7E 671 ( 18) ST hexdif(P2) ; and save as Hex Difference 0350-01 672 ( 7) XAE ; A=Cursor Pointer low byte 0351-31 673 ( 8) XPAL P1 ; restore P1 cursor pointer low byte 0352-C1 00 674 ( 18) LD 0(P1) ; update Cursor position 0354-C9 00 675 ( 18) ST 0(P1) 0356-C2 7B 676 ( 18) LD keywrd(P2) 0358-01 677 ( 7) XAE ; E = last key pressed 0359-C4 10 678 ( 10) LDI #$10 ; LEFT ? 035B-60 679 ( 6) XRE 035C-98 05 680 (9/11) JZ L0364 ; jump if LEFT 035E-C4 11 681 ( 10) LDI #$11 ; RIGHT ? 0360-60 682 ( 6) XRE 0361-9C 1D 683 (9/11) JNZ L0380 ; jump if not RIGHT 0363-AA 7C 684 ( 22) L0364: ILD curspd(P2) ; LEFT or RIGHT - increment and load Cursor Speed Counter 0365-01 685 ( 7) XAE ; transfer to E 0366-C4 F0 686 ( 10) LDI #$F0 0368-50 687 ( 6) ANE ; A AND E - clear lower nibble 0369-98 0B 688 (9/11) JZ L0376 ; jump if high nibble was zero 036B-C4 0F 689 ( 10) LDI #$0F 036D-50 690 ( 6) ANE ; A AND E - clear high nibble 036E-98 06 691 (9/11) JZ L0376 ; jump if low nibble was zero 0370-DC 30 692 ( 10) ORI #$30 ; set bits 4 and 5 0372-CA 7C 693 ( 18) ST curspd(P2) ; and update Cursor Speed Counter 0374-90 C4 694 ( 11) L0374: JMP L033A ; return from subroutine call 0376- 695 ; 0376-8F FF 696 ( 13+) L0376: DLY #$FF ; delay 131mS (13+514*255)uS 0378-8F FF 697 ( 13+) DLY #$FF ; delay 131mS (13+514*255)uS 037A-C2 A1 698 ( 18) LD PORTB(P2) ; read keyboard column 037C-E4 FF 699 ( 10) XRI #$FF ; invert all bits 037E-9C BA 700 (9/11) JNZ L033A ; result will be non-zero if key pressed - return 0380-C2 A1 701 ( 18) L0380: LD PORTB(P2) ; read keyboard column 0382-E4 FF 702 ( 10) XRI #$FF ; invert all bits 0384-01 703 ( 7) XAE ; put result in E 0385-8F 20 704 ( 13+) DLY #$20 ; debounce 16.4mS (13+514*32)uS 0387-C2 A1 705 ( 18) LD PORTB(P2) ; reread keyboard column 0389-E4 FF 706 ( 10) XRI #$FF ; invert all bits 038B-58 707 ( 6) ORE ; OR with previous value read 038C-9C F2 708 (9/11) JNZ L0380 ; result non-zero if key pressed, round again waiting for release 038E-C4 04 709 ( 10) L038E: LDI #$04 ; key released 0390-07 710 ( 6) CAS ; set Flag 2 (suspend CPU) 0391-C4 00 711 ( 10) LDI #$00 ; resumes when a key has been pressed 0393-CA 7C 712 ( 18) ST curspd(P2) ; clear Cursor Speed Counter 0395-C4 00 713 ( 10) LDI #$00 0397-07 714 ( 6) CAS ; clear all flags 0398-CA 7B 715 ( 18) ST keywrd(P2) ; clear Keyword 039A-C2 A1 716 ( 18) LD PORTB(P2) ; read keyboard column 039C-E4 FF 717 ( 10) XRI #$FF ; invert all bits 039E-01 718 ( 7) XAE ; put result in E 039F-8F 20 719 ( 13+) DLY #$20 ; debounce 0.56mS (13+2*?+514*32)uS 03A1-C2 A1 720 ( 18) LD PORTB(P2) ; read keyboard column 03A3-E4 FF 721 ( 10) XRI #$FF ; invert all bits 03A5-50 722 ( 6) ANE ; AND with previous value read 03A6-98 E6 723 (9/11) JZ L038E ; if not the same bouncing so round again 03A8-1C 724 ( 5) L03A8: SR ; shift right to lose LSB 03A9-98 06 725 (9/11) JZ L03B1 ; if zero then we have found the column bit that was active 03AB-01 726 ( 7) XAE ; not zero - save A in E 03AC-AA 7B 727 ( 22) ILD keywrd(P2) ; increment Keyword (Column value) 03AE-01 728 ( 7) XAE ; retrieve A 03AF-90 F7 729 ( 11) JMP L03A8 ; and go around again 03B1- 730 ; 03B1-C4 98 731 ( 10) L03B1: LDI #$98 03B3-CA 7F 732 ( 18) ST prompt(P2) ; Mode Flag=(1001 1000) 03B5-BA 7F 733 ( 22) L03B5: DLD prompt(P2) ; decrement Mode Flag 03B7-01 734 ( 7) XAE ; E=Mode Flag 03B8-C4 92 735 ( 10) LDI #$92 03BA-60 736 ( 6) XRE ; A=(E EOR 1001 0010) 03BB-98 D1 737 (9/11) JZ L038E ; suspend CPU ? 03BD-CA 80 738 ( 18) ST E(P2) ; Set keyboard Row ($0790 for bit-0 to $0797 for bit-7) 03BF-C2 A1 739 ( 18) LD PORTB(P2) ; read Port B keyboard column 03C1-E4 FF 740 ( 10) XRI #$FF ; invert 03C3-98 AF 741 (9/11) JZ L0374 ; and return as key has been released 03C5-02 742 ( 5) CCL ; clear carry ready for addition 03C6-C2 7B 743 ( 18) LD keywrd(P2) 03C8-F4 07 744 ( 11) ADI #$07 ; add $07 to Keyword (7 keys in a Row) 03CA-CA 7B 745 ( 18) ST keywrd(P2) 03CC-90 E7 746 ( 11) JMP L03B5 ; and round again 03CE- 747 ; 03CE-3F 748 ( 7) L03CE: XPPC P3 ; return from subroutine call 03CF- 749 ; 03CF- 750 ; Serial Routine - Receive ? 03CF-06 751 ( 5) L03CF: CSA ; status to A 03D0-D4 20 752 ( 10) ANI #$20 ; (AND with A) test SB (serial input) 03D2-9C FB 753 (9/11) JNZ L03CF ; wait for input low 03D4-06 754 ( 5) L03D4: CSA ; status to A 03D5-D4 20 755 ( 10) ANI #$20 ; test SB 03D7-98 FB 756 (9/11) JZ L03D4 ; and then wait for high transition 03D9-C4 60 757 ( 10) LDI #$60 03DB-8F 00 758 ( 13+) DLY #$00 ; delay 0.205mS (13+2*96)uS 03DD-19 759 ( 5) SIO ; shift SIN into E 03DE-40 760 ( 6) LDE ; copy E to A 03DF-90 ED 761 ( 11) JMP L03CE ; and return 03E1- 762 ; 03E1-3F 763 ( 7) L03E1: XPPC P3 ; return from subroutine call 03E2- 764 ; 03E2- 765 ; Serial Routine - Transmit ? 03E2-C4 01 766 ( 10) LDI #$01 03E4-50 767 ( 6) ANE ; A=A AND E, mask LS bit 03E5-19 768 ( 5) SIO ; and send to SOUT 03E6-98 0D 769 (9/11) JZ L03F5 ; branch if bit was a zero 03E8-C4 38 770 ( 10) LDI #$38 03EA-8F 00 771 ( 13+) DLY #$00 ; delay 0.125mS (13+2*56)uS 03EC-C4 00 772 ( 10) LDI #$00 03EE-01 773 ( 7) XAE ; E=0 03EF-19 774 ( 5) SIO ; send a zero to SOUT 03F0-01 775 ( 7) XAE ; E=0 03F1-C4 4D 776 ( 10) LDI #$4D 03F3-8F 00 777 ( 13+) DLY #$00 ; delay 0.167mS (13+2*77)uS 03F5-C4 50 778 ( 10) L03F5: LDI #$50 03F7-8F 00 779 ( 13+) DLY #$00 ; delay 0.173mS (13+2*80)uS 03F9-01 780 ( 7) XAE ; E=$FF 03FA-19 781 ( 5) SIO ; send a one to SOUT 03FB-01 782 ( 7) XAE ; E=$FF 03FC-C4 40 783 ( 10) LDI #$40 03FE-90 E1 784 ( 11) JMP L03E1 ; and return