0000- 4 0000-26 08 5 RESET: MVI H,$08 ;PAGE ADRS OF WRITE TEST RAM 0002-7E 6 MOV A,M ;TEST RAM CELL DATA 0003-2F 7 CMA ;COMPLEMENT IT 0004-77 8 MOV M,A ;STORE IT BCK IN RAM 0005-C3 40 00 9 JMP STRT ;TO CONTINUE 0008- 10 ; 0008- 11 ;RS1 IS MAIN ENTRY POINT TO MONITOR 0008- 12 ; 0008-22 D3 0B 13 RS1: SHLD TSAVH ;SAVE USER HL CONTENTS IN RAM 000B-D3 10 14 OUT $10 ;UNPROTECT RAM 000D-C3 F3 00 15 JMP TRP ;CONTINUE 0010- 16 ; 0010- 17 ;BEEP PRODUCES A FIXED TONE FREQ + DURATION 0010- 18 ; 0010-06 06 19 BEEP: MVI B,FREQ ;DEFAULT FREQUENCY 0012-16 04 20 BEEP1: MVI D,DURA ;DEFAULT DURATION 0014-C3 47 04 21 JMP BEEP2 ;CONTINUE 0017-00 22 NOP 0018- 23 ; 0018- 24 ;STDM STORES DISP MESSAGE AT DE ADRS IN UDSP RAM 0018- 25 ; 0018-C5 26 STDM: PUSH B 0019-21 F0 0B 27 LXI H,UDSP0 ;ADRS OF UNDECODED DISPLAY DIGIT 0 001C-C3 35 02 28 JMP SDM ;CONTINUE 001F-00 29 NOP 0020-C3 F0 0A 30 RS4: JMP RS4C ;USER ROUTINE 0023-00 31 NOP 0024-C3 08 00 32 TRAP: JMP RS1 ;SAV USER REGS+RETURN TO MONITOR 0027-00 33 NOP 0028-C3 F3 0A 34 RS5: JMP RS5C ;USER ROUTINE 002B-00 35 NOP 002C-C3 F6 0A 36 RS55: JMP RS55C ;USER ROUTINE 002F-00 37 NOP 0030-C3 F9 0A 38 RS6: JMP RS6C ;USER ROUTINE 0033-00 39 NOP 0034-C3 FC 0A 40 RS65: JMP RS65C ;USER ROUTINE 0037-00 41 NOP 0038-C3 A6 00 42 RS7: JMP STRT6 ;RETURN TO MONITOR 003B-00 43 NOP 003C-D7 44 RS75: RST 2 ;BEEP 003D-C3 8D 04 45 JMP SATL1 ;SA TEST LOOP 0040- 46 ; 0040- 47 ;POWER-UP SELF TEST AND INITIALIZE 0040- 48 ; 0040-BE 49 STRT: CMP M ;SEE IF DATA IS STORED IN RAM 0041-C2 C8 00 50 JNZ PPER ;IF RAM WAS INITIALIZED (RUN MODE) 0044-31 CE 0B 51 LXI SP,MSP ;INITIALIZE MONITOR SP 0047-AF 52 XRA A ;CLEAR A 0048-67 53 MOV H,A ;CLEAR H FIRST ADRS 0049-6F 54 MOV L,A ;CLEAR L OR ROM 004A-D3 30 55 OUT LOUT ;TURN ON OUTPUT LEDS 004C- 56 ; 004C- 57 ;ROM SELF TEST 004C- 58 ; 004C-86 59 STRT1: ADD M ;ADD ROM DATA TO A 004D-23 60 INX H ;POINT TO NEXT ROM ADRS 004E-4F 61 MOV C,A ;SAVE A RESIDUE IN C 004F-3E 08 62 MVI A,$08 ;LAST ADRS OF ROM+1 (MSBYTE) 0051-BC 63 CMP H ;COMPARE IT TO H 0052-79 64 MOV A,C ;RESTORE RESIDUE TO A 0053-C2 4C 00 65 JNZ STRT1 ;IF LAST ROM ADRS NOT 0800 0056-2B 66 DCX H ;PONT HL TO 07FF CHECKSUM VALUE 0057-96 67 SUB M ;SUSTRACT CHECKSUM FOR A RESIDUE 0058-BE 68 CMP M ;COMPARE RESIDUE TO CHECKSUM 0059-06 04 69 MVI B,$04 ;IC 4 (ROM) MESSAGE 005B-C2 E5 00 70 JNZ MERR1 ;IF NOT A MATCH 005E- 71 ; 005E- 72 ;RAM SELF TEST 005E- 73 ; 005E-AF 74 XRA A ;CLEAR A 005F-21 00 08 75 LXI H,$0800 ;1ST RAM ADDR 0062-06 03 76 MVI B,$03 ;ADD CONSTANT 0064-77 77 STRT2: MOV M,A ;STORE DATA IN RAM 0065-80 78 ADD B ;ADD 3 TO A 0066-23 79 INX H ;POINT TO NEXT RAM ADRS 0067-4F 80 MOV C,A ;SAVE A 0068-7C 81 MOV A,H ;GET MSBYTE ADRS 0069-FE 0C 82 CPI $0C ;LAST RAM ADRS+1 006B-79 83 MOV A,C ;RESTORE A 006C-C2 64 00 84 JNZ STRT2 ;IF NOT LAST RAM ADRS 006F-AF 85 XRA A ;CLEAR A 0070-21 00 08 86 LXI H,$0800 ;1ST RAM ADRS 0073-BE 87 STRT3: CMP M ;DID DATA GET STORED IN RAM? 0074-C2 DC 00 88 JNZ MERR ;IF DATA NOT SAME 0077-2F 89 CMA 0078-77 90 MOV M,A ;STORE COMPLEMENT BACK IN RAM 0079-BE 91 CMP M ;DID IT STORE? 007A-C2 DC 00 92 JNZ MERR ;IF NOT 007D-2F 93 CMA ;UNCOMPLEMENT A 007E-80 94 ADD B ;ADD 3 TO A 007F-23 95 INX H ;NEXT RAM ADDR 0080-4F 96 MOV C,A ;SAVE A 0081-7C 97 MOV A,H ;GET MSBYTE ADRS 0082-FE 0C 98 CPI $0C ;LAST RAM ADRS+1 0084-79 99 MOV A,C ;RESTORE A 0085-C2 73 00 100 JNZ STRT3 ;TO CHECK NEXT RAM LOCATION 0088- 101 ; 0088- 102 ;DISPLAY TEST 0088- 103 ; 0088-06 00 104 MVI B,$00 ;CLEAR LOOP COUNTER 008A-11 81 02 105 STRT4: LXI D,ALL ;DISPLAY MESSAGE POINTER ALL SEGS 008D-DF 106 RST 3 ;GET MESSAGE 008E-CD E9 01 107 CALL DCD ;UPDATE DISPLAY 0091-05 108 DCR B ;DECR LOOP COUNTER 0092-C2 8A 00 109 JNZ STRT4 ;IF NOT DONE 0095- 110 ; 0095- 111 ;CLEAR RAM (STORE 00 IN ALL LOCATIONS) 0095- 112 ; 0095-06 00 113 MVI B,$00 ;CLEAR B 0097-3E 0C 114 MVI A,$0C ;MSBYTE ADRS OF TOP OF RAM+1 0099-21 00 08 115 LXI H,$0800 ;1ST ADRS OF RAM 009C-70 116 STRT5: MOV M,B ;CLEAR RAM LOCATION 009D-23 117 INX H ;POINT TO NEXT LOCATION 009E-BC 118 CMP H ;TO LAST RAM ADRS+1 009F-C2 9C 00 119 JNZ STRT5 ;IF NOT DONE CLEARING RAM 00A2-3E FF 120 MVI A,$FF ;SET A TO ALL ONES 00A4-D3 30 121 OUT LOUT ;TURN OF OUTPUT LEDS 00A6-D7 122 STRT6: RST 2 ;SIGNAL START-UP DONE 00A7- 123 ; 00A7- 124 ; INITIALIZE REGISTERS 00A7- 125 ; 00A7-21 B0 0B 126 LXI H,USP ;USER SP DEFAULT VALUE 00AA-22 DE 0B 127 SHLD SAVSL ;STORE IT IN RAM 00AD-21 D6 0B 128 LXI H,RS ;RUN STATUS WORD ADRS 00B0-36 00 129 MVI M,$00 ;SET STATUS TO MONITOR 00B2-3E 0B 130 MVI A,DIM ;DEFAULT INTERRUPT MASK 00B4-32 DB 0B 131 STA SAVIM ;STORE IT IN RAM 00B7-21 00 08 132 STRT7: LXI H,PC ;DEFAULT PC 00BA-22 DC 0B 133 SHLD SAVPC ;STORE IT IN RAM 00BD-3E FF 134 MVI A,$FF ;RST7 INSTR CODE 00BF-32 FF 0A 135 STA TPR ;STORE IT IN TOP OF PROTECTED RAM 00C2-32 EF 0A 136 STA UR ;STORE IT IN UPPER RAM BELOW LINKS 00C5-C3 11 01 137 JMP TRP3 ;JUMP TO MONITOR 00C8- 138 ; 00C8- 139 ;PUSH-POP ERROR ROUTINE 00C8- 140 ; 00C8-31 CE 0B 141 PPER: LXI SP,MSP ;SET MONITOR SP 00CB-21 00 08 142 LXI H,PC ;DEFAULT PC 00CE-22 DC 0B 143 SHLD SAVPC ;STORE IT IN RAM 00D1-D7 144 RST 2 ;SIGNAL AN ERROR 00D2-AF 145 XRA A ;CLEAR A 00D3-32 D6 0B 146 STA RS ;SET RUN STATUS TO MONITOR 00D6-11 8D 02 147 LXI D,PPM ;PUSH-POP ERROR MESSAGE ADRS 00D9-C3 15 01 148 JMP TRP4 00DC- 149 ; 00DC- 150 ;MEMORY ERROR SORT 00DC- 151 ; 00DC-06 06 152 MERR: MVI B,$06 ;IC6 RAM FAIL MESSAGE 00DE-AE 153 XRA M ;GET DIFFERENCE INTO A 00DF-E6 0F 154 ANI $0F ;TEST 4LSB'S OF IC6 00E1-CA E5 00 155 JZ MERR1 ;IF PROBLEM IN IC6 00E4-05 156 DCR B ;SET B TO IC5 00E5-11 87 02 157 MERR1: LXI D,ICX ;ICX MESSAGE ADRS 00E8-DF 158 RST 3 ;GET MESSAGE 00E9-21 F2 0B 159 LXI H,UDSP2 ;ADRS OF ICX IN UDSP RAM 00EC-70 160 MOV M,B ;STORE IC NUMBER IN UDSP2 00ED-CD E9 01 161 MERR2: CALL DCD ;DISPLAY MESSAGE 00F0-C3 ED 00 162 JMP MERR2 ;LOOP MESSAGE 00F3- 163 ; 00F3- 164 ;RS1 IS MAIN ENTRY POINT TO MONITOR 00F3- 165 ; 00F3-21 00 00 166 TRP: LXI H,$0000 ;CLEAR H,L 00F6-D2 FA 00 167 JNC TRP1 ;NO USER CARRY WILL BYPASS DCXH 00F9-2B 168 DCX H ;SET H,L TO FF IF CARRY PRESENT 00FA-39 169 TRP1: DAD SP ;GET SP VALUE INTO HL, RESTORE CY 00FB-D2 FF 00 170 JNC TRP2 ;IF JNC TO TRP1 OCCURED 00FE-23 171 INX H ;IF DCXH OCCURED BECAUSE OF CARRY 00FF-22 D1 0B 172 TRP2: SHLD TSAVSP ;SAVE USER SP IN RAM 0102-31 D1 0B 173 LXI SP,TSAVSP ;TSAVA+1 ADRS 0105-F5 174 PUSH PSW ;SAVE PSW AND A IN RAM 0106-21 D6 0B 175 LXI H,RS ;RUN STATUS ADRS 0109-AF 176 XRA A ;CLEAR A 010A-BE 177 CMP M ;FOR RUN STATUS=MONITOR 010B-32 F6 0B 178 STA UDSP6 ;CLEAR DATA MODIFY FLAG 010E-C2 24 01 179 JNZ TRP6 ;IF CAME FROM USER PROGRAM 0111-11 41 02 180 TRP3: LXI D,DMT ;ULAB MESSAGE ADRS 0114-FB 181 EI 0115-3E 0B 182 TRP4: MVI A,DIM ;DEFAULT INTERRUPT MASK 0117-30 183 SIM ;SET IT TO ENABLE RST7.5 ONLY 0118-D3 10 184 OUT $10 ;UNPROTECT RAM 011A-DF 185 RST 3 ;GET MESSAGE 011B-CD 4B 01 186 TRP5: CALL KIND ;INPUT KEYS 011E-CD B8 02 187 CALL CFETA ;LOOK FOR ACCEPTABLE KEYS 0121-C3 1B 01 188 JMP TRP5 ;TRY AGAIN 0124-77 189 TRP6: MOV M,A ;STORE 0 IN RS TO SET MONITOR 0125- 190 ; 0125- 191 ;SAVE REGISTERS 0125- 192 ; 0125-F1 193 POP PSW ;FROM TSAVPSW IN RAM 0126-E1 194 POP H ;GETS USER SP VALUE FROM RAM 0127-23 195 INX H ;USER SP 0128-23 196 INX H ;USER SP 0129-22 DE 0B 197 SHLD SAVSL ;SAVE SP IN RAM 012C-2B 198 DCX H ;USER SP 012D-2B 199 DCX H ;USER SP 012E-F9 200 SPHL ;RESTORE SP 012F-E1 201 POP H ;GET RETURN ADRS TO USER PROGRAM 0130-22 DC 0B 202 SHLD SAVPC ;STORE IT IN RAM 0133-31 E8 0B 203 LXI SP,$0BE8 ;ADRS OF SAVA+1 0136-2A D3 0B 204 LHLD TSAVH ;RESTORE H,L 0139-F5 205 PUSH PSW ;INTO SAVPSW 013A-C5 206 PUSH B ;INTO SAVB 013B-D5 207 PUSH D ;INTO SAVD 013C-E5 208 PUSH H ;INTO SAVH 013D-20 209 RIM ;GET IM 013E-32 DB 0B 210 STA SAVIM ;STORE IT IN RAM 0141-31 DC 0B 211 TRP7: LXI SP,SAVPC ;POINT IT TO USER SP 0144-C1 212 POP B ;AND POP IT IN BC 0145-31 CE 0B 213 LXI SP,MSP ;RESTORE MONITOR SP 0148-C3 64 03 214 JMP FETA3 014B- 215 ; 014B- 216 ;KEY INPUT AND DECODE 014B- 217 ; 014B-D5 218 KIND: PUSH D 014C-E5 219 PUSH H 014D-CD E9 01 220 KIND1: CALL DCD ;UPDATE DISPLAY AND WAIT 0150-CD 85 01 221 CALL KPU ;CHK FOR PUSHED KEY 0153-C2 4D 01 222 JNZ KIND1 ;IF KEY STILL PUSHED 0156-CD E9 01 223 KIND2: CALL DCD ;UDPATE DISP AND WAIT 0159-CD 85 01 224 CALL KPU ;CHK FOR PUSHED KEY 015C-CA 56 01 225 JZ KIND2 ;IF KEY NOT PUSHED 015F-21 E8 0B 226 LXI H,UDKY ;ADRS OF FIRST KEY ROW TO SCAN 0162-16 FF 227 MVI D,$FF ;LOAD ROW COUNTER TO 0-1 0164-7E 228 KIND3: MOV A,M ;GET ROW N KEY DATA 0165-FE F7 229 CPI $F7 ;IS IT THE HDWR STEP KEY? 0167-CA 82 01 230 JZ KIND5 ;YES JUMPS 016A-2F 231 CMA ;INVERT KEY DATA 016B-2C 232 INR L ;NEXT ROW 016C-14 233 INR D ;NEXT TABLE BLOCK 016D-A7 234 ANA A ;TEST ROW N FOR 0 016E-CA 64 01 235 JZ KIND3 ;JUMP IF KEY NOT PUSHED 0171-FE 04 236 CPI $04 ;SEE IF D3=1 0173-C2 77 01 237 JNZ KIND4 ;IF SO 0176-3D 238 DCR A ;ELSE SET A=3 0177-82 239 KIND4: ADD D ;ADD 3X THE ROW N TO 0178-82 240 ADD D ;GET THE TABLE OFFSET 0179-82 241 ADD D 017A-5F 242 MOV E,A ;STORE TABLE INDEX 017B-16 00 243 MVI D,$00 ;CLEAR MS BYTE OF DE 017D-21 AF 01 244 LXI H,KIT-1 ;ADRS OF KEY CODE TABLE 0180-19 245 DAD D ;ADD INDEX TO TABLE ADRS 0181-7E 246 MOV A,M ;PUT KEY CODE IN A 0182-E1 247 KIND5: POP H 0183-D1 248 POP D 0184-C9 249 RET 0185- 250 ; 0185- 251 ;DETERMINES IF ANY KEY IS PUSHED 0185- 252 ; 0185-C5 253 KPU: PUSH B 0186-CD 9A 01 254 CALL KRD ;READ THE KEYBOARD 0189-06 08 255 MVI B,$08 ;SET THE LOOP COUNTER 018B-21 E8 0B 256 LXI H,UDKY ;ADDRESS OF UNDECODED KEY SCAN 018E-3E FF 257 MVI A,$FF ;UNPUSHED KEY CODE 0190-A6 258 KPU1: ANA M ;LET ANY PUSHED KEY CODE CHANGE A 0191-2C 259 INR L ;NEXT RAM KEY ROW 0192-05 260 DCR B ;LOOP COUNTER 0193-C2 90 01 261 JNZ KPU1 ;IF ALL KEY ROWS NOT ANDED WITH A 0196-FE FF 262 CPI $FF ;SET FLAG IF ALL KEYS NOT PUSHED 0198-C1 263 POP B 0199-C9 264 RET 019A- 265 ; 019A- 266 ;READS KEYS AND STORES THEM IN RAM (UDKY) 019A- 267 ; 019A-21 E8 0B 268 KRD: LXI H,UDKY ;ADRS OF UNDECODED KEY SCAN 019D-3E FF 269 MVI A,$FF ;BLANK DISPLAY CODE 019F-D3 38 270 OUT DSP ;CLEAR DISPLAY 01A1-3D 271 DCR A ;SET A TO 1111 1110 SCAN POINTER 01A2-37 272 STC ;TO RESET END OF SCAN LOOP FLAG 01A3-D3 28 273 KRD1: OUT SCAN ;SCAN ONE KEY ROW 01A5-47 274 MOV B,A ;SAVE SCAN POINTER 01A6-DB 18 275 IN KEY ;INPUT A KEY ROW 01A8-77 276 MOV M,A ;STORE IT IN RAM 01A9-78 277 MOV A,B ;RESTORE SCAN POINTER 01AA-2C 278 INR L ;POINT TO NEXT RAM ADRS 01AB-17 279 RAL ;MOVE SCAN POINTER TO NEXT KEY ROW 01AC-DA A3 01 280 JC KRD1 ;IF LAW KEY ROW NOT SCANNED 01AF-C9 281 RET 01B0- 282 ; 01B0- 283 ;KEY INPUT DECODE TABLE (HDWR STEP IS F7) 01B0- 284 ; 01B0-86 285 KIT: .DB $86 ;INSTR STEP KEY CODE 01B1-85 286 .DB $85 ;FETCH PC KEY CODE 01B2-00 287 .DB $00 ;(UNDEFINED) KEY CODE 01B3-84 288 .DB $84 ;RUN KEY CODE 01B4-80 289 .DB $80 ;FETCH REG KEY CODE 01B5-82 290 .DB $82 ;FETCH ADRS KEY CODE 01B6-00 291 .DB $00 ; 0 KEY CODE 01B7-83 292 .DB $83 ;STORE/INCR KEY CODE 01B8-81 293 .DB $81 ;DECR KEY CODE 01B9-01 294 .DB $01 ; 1 KEY CODE 01BA-02 295 .DB $02 ; 2 KEY CODE 01BB-03 296 .DB $03 ; 3 KEY CODE 01BC-04 297 .DB $04 ; 4 KEY CODE 01BD-05 298 .DB $05 ; 5 KEY CODE 01BE-06 299 .DB $06 ; 6 KEY CODE 01BF-07 300 .DB $07 ; 7 KEY CODE 01C0-08 301 .DB $08 ; 8 KEY CODE 01C1-09 302 .DB $09 ; 9 KEY CODE 01C2-0A 303 .DB $0A ; A KEY CODE 01C3-0B 304 .DB $0B ; B KEY CODE 01C4-0C 305 .DB $0C ; C KEY CODE 01C5-0D 306 .DB $0D ; D KEY CODE 01C6-0E 307 .DB $0E ; E KEY CODE 01C7-0F 308 .DB $0F ; F KEY CODE 01C8- 309 ; 01C8- 310 ;SCAN DISPLAY SEGMENTS 01C8- 311 ; 01C8-F5 312 SDS: PUSH PSW 01C9-E5 313 PUSH H 01CA-C5 314 PUSH B 01CB-21 FF 0B 315 LXI H,DDSP5 ;ADRS OF DECODED DISP DIGIT 5 01CE-06 20 316 MVI B,$20 ;DISP DIGIT 5 SCAN POINTER 01D0-AF 317 SDS1: XRA A ;CLEAR A 01D1-D3 28 318 OUT SCAN ;TURN DISP DIGIT OFF 01D3-7E 319 MOV A,M ;GET SEGMENT DATA 01D4-D3 38 320 OUT DSP ;STORE IT IN DSP LATCH 01D6-78 321 MOV A,B ;GET SCAN DIGIT POINTER 01D7-D3 28 322 OUT SCAN ;TURN ON DISP DIGIT 01D9-CD 29 04 323 CALL DELA ;STRETCH DIGIT 1MS 01DC-2D 324 DCR L ;ADRS OF NEXT DIGIT IN RAM 01DD-1F 325 RAR ;GET SCAN DIGIT POINTER 01DE-47 326 MOV B,A ;SAVE IT IN B 01DF-D2 D0 01 327 JNC SDS1 ;IF NOT LAST SCANNED DIGIT (LSD) 01E2-2F 328 CMA ;SET A=FF BLANK DISP CODE 01E3-D3 38 329 OUT DSP ;TURN OFF DSP DIGITS 01E5-C1 330 POP B 01E6-E1 331 POP H 01E7-F1 332 POP PSW 01E8-C9 333 RET 01E9- 334 ; 01E9- 335 ;DISPLAY CHARACTER DECODER 01E9- 336 ; 01E9-F5 337 DCD: PUSH PSW 01EA-C5 338 PUSH B 01EB-D5 339 PUSH D 01EC-E5 340 PUSH H 01ED-01 FA 0B 341 LXI B,DDSP0 ;DECODED DIGIT FIRST ADRS 01F0-11 F0 0B 342 LXI D,UDSP0 ;UNDECODED DIGIT FIRST ADRS 01F3-21 18 02 343 DCD1: LXI H,DCC ;DIPSLAY CODE CONVERTER TABLE ADRS 01F6-1A 344 LDAX D ;GET UNDECODED DATA FOR OFFSET 01F7-D5 345 PUSH D ;SAVE ITS ADRS 01F8-5F 346 MOV E,A ;TABLE OFFSET VALUE TO E 01F9-16 00 347 MVI D,$00 ;CLEAR D 01FB-19 348 DAD D ;ADD OFFSET VALUE TO DCC ADRS 01FC-7E 349 MOV A,M ;GET DECODED DATA FROM TABLE ADRS 01FD-02 350 STAX B ;STORE IT IN DECODED RAM 01FE-D1 351 POP D ;RESTORE UDSPX ADRS 01FF-1C 352 INR E ;POINT TO NEXT UPSP ADRS 0200-0C 353 INR C ;POINT TO NEXT DDSP ADRS 0201-C2 F3 01 354 JNZ DCD1 ;IF NOT LAST DIGIT 0204-21 FA 0B 355 LXI H,DDSP0 ;DECODED DIGIT 0 0207-1A 356 LDAX D ;UDSP6 DATA MODIFY FLAG 0208-A7 357 ANA A ;CHECK FOR SET FLAG 0209-CA 10 02 358 JZ DCD2 ;IF DATA NOT BEING MODIFIED 020C-7E 359 MOV A,M ;GET DDSP0 DATA 020D-E6 7F 360 ANI $7F ;SET ITS DECIMAL POINT DISP BIT 020F-77 361 MOV M,A ;STORE IT IN DDSP0 0210-E1 362 DCD2: POP H ; 0211-D1 363 POP D ; 0212-C1 364 POP B ; 0213-F1 365 POP PSW ; 0214-CD C8 01 366 CALL SDS ;UDPATE DISPLAY 0217-C9 367 RET ; 0218- 368 ; 0218- 369 ;DISPLAY CODE CONVERTER TABLE 0218- 370 ; 0218-C0 371 DCC: .DB $C0 ;0 0219-F9 372 .DB $F9 ;1 021A-A4 373 .DB $A4 ;2 021B-B0 374 .DB $B0 ;3 021C-99 375 .DB $99 ;4 021D-92 376 .DB $92 ;5 021E-82 377 .DB $82 ;6 021F-F8 378 .DB $F8 ;7 0220-80 379 .DB $80 ;8 0221-90 380 .DB $90 ;9 0222-88 381 .DB $88 ;A 0223-83 382 .DB $83 ;B 0224-C6 383 .DB $C6 ;C 0225-A1 384 .DB $A1 ;D 0226-86 385 .DB $86 ;E 0227-8E 386 .DB $8E ;F 0228-FF 387 .DB $FF ;BLANK 0229-89 388 .DB $89 ;H 022A-C7 389 .DB $C7 ;L 022B-E3 390 .DB $E3 ;U SMALL 022C-8C 391 .DB $8C ;P 022D-A3 392 .DB $A3 ;O 022E-C1 393 .DB $C1 ;U LARGE 022F-F7 394 .DB $F7 ;_ 0230-A7 395 .DB $A7 ;C SMALL 0231-CF 396 .DB $CF ;1 LEFT 0232-00 397 .DB $00 ;ALL SEGS 0233-AF 398 .DB $AF ;R SMALL 0234-BF 399 .DB $BF ;- 0235- 400 ; 0235- 401 ;STDM STORES DISP MESSAGE AT DE ADRS IN UDSP RAM 0235- 402 ; 0235-06 06 403 SDM: MVI B,$06 ;LOOP COUNTER FOR 6 DISPLAY DIGITS 0237-1A 404 SDM1: LDAX D ;DISPLAY CHARACTER 0238-77 405 MOV M,A ;STORE IT IN UPSPX IN RAM 0239-2C 406 INR L ;NEXT UDSP ADRS 023A-13 407 INX D ;NEXT MESSAGE TABLE ADRS 023B-05 408 DCR B ;LOOP COUNTER 023C-C2 37 02 409 JNZ SDM1 ;IF NOT LAST DIGIT 023F-C1 410 POP B ; 0240-C9 411 RET 0241- 412 ; 0241- 413 ;DISPLAY MESSAGE TABLES 0241- 414 ; 0241-14 415 DMT: .DB $14 ;P 0242-16 416 .DB $16 ;U 0243-0B 417 .DB $0B ;B 0244-0A 418 .DB $0A ;A 0245-12 419 .DB $12 ;L 0246-13 420 .DB $13 ;U SMALL 0247-10 421 FETCH: .DB $10 ;SP 0248-10 422 .DB $10 ;SP 0249-17 423 .DB $17 ;_ 024A-17 424 .DB $17 ;_ 024B-17 425 .DB $17 ;_ 024C-17 426 .DB $17 ;_ 024D-0A 427 MA: .DB $0A ;A 024E-10 428 .DB $10 ;SP 024F-10 429 .DB $10 ;SP 0250-10 430 .DB $10 ;SP 0251-12 431 FLG: .DB $12 ;L 0252-0F 432 .DB $0F ;F 0253-10 433 .DB $10 ;SP 0254-10 434 .DB $10 ;SP 0255-0B 435 MB: .DB $0B ;B 0256-10 436 .DB $10 ;SP 0257-10 437 .DB $10 ;SP 0258-10 438 .DB $10 ;SP 0259-0C 439 MC: .DB $0C ;C 025A-10 440 .DB $10 ;SP 025B-10 441 .DB $10 ;SP 025C-10 442 .DB $10 ;SP 025D-0D 443 MD: .DB $0D ;D 025E-10 444 .DB $10 ;SP 025F-10 445 .DB $10 ;SP 0260-10 446 .DB $10 ;SP 0261-0E 447 ME: .DB $0E ;E 0262-10 448 .DB $10 ;SP 0263-10 449 .DB $10 ;SP 0264-10 450 .DB $10 ;SP 0265-11 451 MH: .DB $11 ;H 0266-10 452 .DB $10 ;SP 0267-10 453 .DB $10 ;SP 0268-10 454 .DB $10 ;SP 0269-12 455 ML: .DB $12 ;L 026A-10 456 .DB $10 ;SP 026B-10 457 .DB $10 ;SP 026C-10 458 .DB $10 ;SP 026D-11 459 SPH: .DB $11 ;H 026E-14 460 .DB $14 ;P 026F-05 461 .DB $05 ;S 0270-10 462 .DB $10 ;SP 0271-12 463 SPL: .DB $12 ;L 0272-14 464 .DB $14 ;P 0273-05 465 .DB $05 ;S 0274-10 466 .DB $10 ;SP 0275-11 467 PCH: .DB $11 ;H 0276-0C 468 .DB $0C ;C 0277-14 469 .DB $14 ;P 0278-10 470 .DB $10 ;SP 0279-12 471 PCL: .DB $12 ;L 027A-0C 472 .DB $0C ;C 027B-14 473 .DB $14 ;P 027C-10 474 .DB $10 ;SP 027D-19 475 IM: .DB $19 ;I 027E-10 476 .DB $10 ;SP 027F-10 477 .DB $10 ;SP 0280-10 478 .DB $10 ;SP 0281-1A 479 ALL: .DB $1A ;ALL 0282-1A 480 .DB $1A ;ALL 0283-1A 481 .DB $1A ;ALL 0284-1A 482 .DB $1A ;ALL 0285-1A 483 .DB $1A ;ALL 0286-1A 484 .DB $1A ;ALL 0287-10 485 ICX: .DB $10 ;SP 0288-10 486 .DB $10 ;SP 0289-10 487 .DB $10 ;SP 028A-0C 488 .DB $0C ;C 028B-01 489 .DB $01 ;I 028C-10 490 .DB $10 ;SP 028D-1B 491 PPM: .DB $1B ;R SMALL 028E-0E 492 .DB $0E ;E 028F-14 493 .DB $14 ;P 0290-05 494 .DB $05 ;S 0291-10 495 BLNKM: .DB $10 ;SP 0292-10 496 .DB $10 ;SP 0293-10 497 .DB $10 ;SP 0294-10 498 .DB $10 ;SP 0295-10 499 .DB $10 ;SP 0296-10 500 .DB $10 ;SP 0297- 501 ; 0297- 502 ;BLANK THE DISPLAY 0297- 503 ; 0297-11 91 02 504 BLNK: LXI D,BLNKM ;ADRS OF BLNAK MESSAGE TABLE 029A-DF 505 RST 3 ;GET MESSAGE 029B-CD E9 01 506 CALL DCD ;SEND TO DISPLAY 029E-C9 507 RET 029F- 508 ; 029F- 509 ;CONTRL KEY JUMP TABLE 029F- 510 ; 029F-FE F7 511 CHDSS: CPI $F7 ;HARDWARE SINGLE STEP PUSHED? 02A1-CA F7 03 512 JZ HDSS ;HARDWARE SINGLE STEP ROUTINE 02A4-FE 86 513 CINSS: CPI $86 ;SOFTWARE SINGLE STEP PUSHED? 02A6-CA F1 03 514 JZ INSS ;SOFTWARE SINGLE STEP ROUTINE 02A9-FE 84 515 CRUN: CPI $84 ;RUN PUSHED? 02AB-CA C2 03 516 JZ RUN ;RUN ROUTINE 02AE-FE 83 517 CSTRM: CPI $83 ;STORE MEMORY PUSHED? 02B0-CA AF 03 518 JZ STRM ;STORE MEMORY ROUTINE 02B3-FE 81 519 CDCRM: CPI $81 ;DECREMENT MEMORY PUSHED? 02B5-CA AA 03 520 JZ DCRM ;DECREMENT MEMORY ROUTINE 02B8-FE 82 521 CFETA: CPI $82 ;FETCH ADRS PUSHED? 02BA-CA 28 03 522 JZ FETA ;FETCH ADRS ROUTINE 02BD-FE 85 523 CFETP: CPI $85 ;FETCH PROGRAM COUNTER PUSHED? 02BF-CA 41 01 524 JZ TRP7 ;FETCH PROGRAM COUNTER ROUTINE 02C2-FE 80 525 CFETR: CPI $80 ;FETCH REGISTER PUSHED? 02C4-CA D5 02 526 JZ FETR ;FETCH REGISTER ROUTINE 02C7-C9 527 RET ;IF NO LEGAL KEY WAS PUSHED 02C8-FE 83 528 CSTRR: CPI $83 ;STORE REGISTER PUSHED? 02CA-CA 13 04 529 JZ STRR ;STORE REGISTER ROUTINE 02CD-FE 81 530 CDCRR: CPI $81 ;DECREMENT REGISTER PUSHED? 02CF-CA FD 03 531 JZ DCRR ;DECREMENT REGISTER ROUTINE 02D2-C3 B8 02 532 JMP CFETA ; 02D5- 533 ; 02D5- 534 ;FETCH REGISTER MODE 02D5- 535 ; 02D5-E1 536 FETR: POP H ;UNDO STACK CALL 02D6-21 4D 02 537 LXI H,MA ;A REG MESSAGE ADRS 02D9-01 E7 0B 538 LXI B,SAVA ;ADRS OF USER A REG CONTENTS 02DC-2B 539 FETR1: DCX H ;6-2=4 CHARACTERS IN REG MESSAGE 02DD-2B 540 DCX H ; 02DE-22 F8 0B 541 FETR2: SHLD RMP ;STORE IN REGISTER MESSAGE POINTER 02E1-EB 542 XCHG ;PUT MESSAGE ADRS IN DE 02E2-DF 543 RST 3 ;STORE MESSAGE IN RAM 02E3-0A 544 LDAX B ;USERS REG CONTENTS 02E4-5F 545 MOV E,A ;TRANSFER IT TO E 02E5-21 F1 0B 546 LXI H,UDSP1 ;ADRS WHERE DISPLAY REG DATA GOES 02E8-CD 9C 03 547 CALL FETA7 ;FORMAT REG BYTE DATA + STORE IT 02EB-3E DB 548 MVI A,$DB ;LS BYTE OF SAVIM ADRS 02ED-B9 549 CMP C ;IS REG EXAMINED THE INTRPT MASK? 02EE-CA 10 03 550 JZ FETR6 ;IF IT IS- HEX KEY INPUT NOT LEGAL 02F1-CD 4B 01 551 FETR3: CALL KIND ;INPUT KEYS 02F4-CD C8 02 552 CALL CSTRR ;LOOK FOR CONTROL 02F7-D2 F1 02 553 JNC FETR3 ;IF NOT A HEX KEY OR NEW CONTROL 02FA-5F 554 MOV E,A ;SAVE 1ST HEX KEY IN E 02FB-2C 555 INR L ;POINT TO UDSP1 02FC-36 00 556 MVI M,$00 ;CLEAR IT TO DISPLAY A 0 02FE-2D 557 FETR4: DCR L ;POINT BACK TO UDSP0 02FF-73 558 MOV M,E ;STORE NEW HEX KEY THERE 0300-CD 19 03 559 FETR5: CALL DPS ;TO SET DP AND INPUT KEYS 0303-CD C8 02 560 CALL CSTRR ;LOOK FOR CONTROL 0306-D2 00 03 561 JNC FETR5 ;IF NOT A HEX KEY OR NEW CONTROL 0309-2C 562 INR L ;POINT TO UDSP1 030A-53 563 MOV D,E ;PUT OLD NEX CHARACTER INTO D 030B-5F 564 MOV E,A ;PUT NEW HEX CHARACTER INTO E 030C-72 565 MOV M,D ;STORE OLD HEX CHARACTER INTO DSP1 030D-C3 FE 02 566 JMP FETR4 ;CONTINUE 0310-CD 4B 01 567 FETR6: CALL KIND ;INPUT KEYS AND UPDATE DISPLAY 0313-CD C8 02 568 CALL CSTRR ;LOOK FOR CONTROL ONLY 0316-C3 10 03 569 JMP FETR6 ;KEEP LOOKING 0319- 570 ; 0319- 571 ;DECIMAL POINT SET 0319- 572 ; 0319-3E 01 573 DPS: MVI A,$01 ;FLAG SET DATA 031B-32 F6 0B 574 STA UDSP6 ;SET DATA MODIFY FLAG 031E-CD 4B 01 575 CALL KIND ;GET ANOTHER KEY 0321-F5 576 PUSH PSW ;SAVE KEY CODE 0322-AF 577 XRA A ;CLEAR A 0323-32 F6 0B 578 STA UDSP6 ;CLEAR DATA MODIFY FLAG 0326-F1 579 POP PSW ;RECOVER KEY CODE 0327-C9 580 RET 0328- 581 ; 0328- 582 ;FETCH MEMORY ADDRESS 0328- 583 ; 0328-D1 584 FETA: POP D ;UNDO STACK CALL 0329-11 47 02 585 FETAR: LXI D,FETCH ;DISPLAY MESSAGE ADRS 032C-DF 586 RST 3 ;STORE MESSAGE IN RAM 032D-0E 04 587 MVI C,$04 ;ADRS DIGIT COUNTER 032F-CD 4B 01 588 FETA1: CALL KIND ;READ KEYS AND SCAN DISPLAY 0332-CD B8 02 589 CALL CFETA ;LOOK FOR CONTROL 0335-D2 2F 03 590 JNC FETA1 ;IF NOT A HEX KEY OR NEW CONTROL 0338-21 F6 0B 591 LXI H,UDSP6 ;ADRS OF DISPLAY DIGIT 4+2 033B-47 592 MOV B,A ;SAVE HEX KEY INPUT 033C-FE 01 593 CPI $01 ;1 KEY PUSHED? 033E-C2 4A 03 594 JNZ NCTL ;IF NOT 0341-3E 04 595 MVI A,$04 ;MS ADRS POSITION VALUE 0343-B9 596 CMP C ;ADRS POSITION POINTER 0344-C2 4A 03 597 JNZ NCTL ;IF 1 KEY NOT MS ADRS BYTE 0347-C3 29 03 598 JMP FETAR ;WAIT FOR ANOTHER KEY 034A-78 599 NCTL: MOV A,B ;RESTORE NON-1 KEY VALUE 034B-06 04 600 MVI B,$04 ;DISPLAY POSITION COUNTER 034D-2D 601 FETA2: DCR L ;POINT TO DISP DIGIT ON RIGHT 034E-2D 602 DCR L ;POINT TO DISP DIGIT ON RIGHT 034F-56 603 MOV D,M ;PUT THIS CHARACTER IN D 0350-2C 604 INR L ;POINT TO DISP DIGIT ON LEFT 0351-72 605 MOV M,D ;STORE THE DIGIT SHIFTED 1 TO LEFT 0352-05 606 DCR B ;POSITION COUNTER 0353-C2 4D 03 607 JNZ FETA2 ;IF NOT DONE ENTERING ADRS 0356-77 608 MOV M,A ;KEY CODE TO DISP DIGIT ON LEFT 0357-0D 609 DCR C ;DIGIT COUNTER 0358-C2 2F 03 610 JNZ FETA1 ;IF NOT DONE 035B-CD 93 03 611 CALL FETA6 ;MERGE LS ADRS BYTE IN DISP TO A 035E-4F 612 MOV C,A ;STORE MERGED BYTE IN C 035F-2C 613 INR L ;POINT TO MS ADRS BYTE IN DISP 0360-CD 93 03 614 CALL FETA6 ;MERGE IT IN A 0363-47 615 MOV B,A ;MERGE IT IN C 0364-21 F5 0B 616 FETA3: LXI H,UDSP5 ;ADRS OF DISP DIGIT 5 0367-58 617 MOV E,B ;PUT MS ADRS BYTE IN E 0368-CD 9C 03 618 CALL FETA7 ;SEPARATE AND STORE IT IN RAM 036B-2D 619 DCR L ;POINT TO UDSP3 036C-59 620 MOV E,C ;SAVE LS ADRS BYTE 036D-CD 9C 03 621 CALL FETA7 ;SEPARATE AND STORE IT IN RAM 0370-2D 622 DCR L ;POINT TO UDSP1 0371-0A 623 LDAX B ;GET DATA AT FETCH ADRS 0372-5F 624 MOV E,A ;PUT IT IN E 0373-CD 9C 03 625 CALL FETA7 ;SEPARATE IT AND DISP IT AS DATA 0376- 626 ; 0376- 627 ;MODIFY THE DATA 0376- 628 ; 0376-CD 4B 01 629 CALL KIND ;GET A KEY 0379-CD 9F 02 630 CALL CHDSS ;LOOK FOR ANY CONTROL KEY 037C-5F 631 MOV E,A ;STORE HEX KEY IN E 037D-77 632 MOV M,A ;AND UDSP0 037E-2C 633 INR L ;POINT TO UDSP1 037F-36 00 634 MVI M,$00 ;CLEAR IT 0381-2D 635 FETA4: DCR L ;POINT TO UDSP0 0382-73 636 MOV M,E ;STORE LATEST KEY ENTRY THERE 0383-CD 19 03 637 FETA5: CALL DPS ;TO SET DP AND INPUT KEYS 0386-CD AE 02 638 CALL CSTRM ;LOOK FOR CONTROL KEY 0389-D2 83 03 639 JNC FETA5 ;IF NOT A VALID KEY 038C-2C 640 INR L ;POINT TO UDSP1 038D-53 641 MOV D,E ;LAST KEY ENTRY 038E-5F 642 MOV E,A ;NEW KEY ENTRY 038F-72 643 MOV M,D ;LAST ENTRY SHIFTED TO UDSP1 0390-C3 81 03 644 JMP FETA4 ;UPDATE NEW KEY AND CONTINUE 0393- 645 ; 0393- 646 ;MERGES 2 HEX NUMBERS INTO A REG 0393- 647 ; 0393-5E 648 FETA6: MOV E,M ;LS HEX CHAR 0394-23 649 INX H ;POINT TO MS HEX CHAR 0395-7E 650 MOV A,M ;MS HEX CHAR 0396-07 651 RLC ;MOVE IT TO 4 MS BITS IN A 0397-07 652 RLC ;AND CLEAR 4 LS BITS IN A 0398-07 653 RLC ; 0399-07 654 RLC ; 039A-B3 655 ORA E ;MERGE MS AND LS HEX CHARS IN A 039B-C9 656 RET 039C- 657 ; 039C- 658 ;SEPARATES 2 HEX CHARACTERS IN A + STORES IN M 039C- 659 ; 039C-7B 660 FETA7: MOV A,E ;PUT MERGED HEX CHARS INTO A 039D-0F 661 RRC ;MOVE MS HEX CHAR TO 4 LS BITS A 039E-0F 662 RRC ; 039F-0F 663 RRC ; 03A0-0F 664 RRC ; 03A1-16 0F 665 MVI D,$0F ;MASK TO CLEAR 4 MS BITS 03A3-A2 666 ANA D ;DO IT 03A4-77 667 MOV M,A ;STORE MS HEX CHAR 03A5-2D 668 DCR L ;LS CHAR DESTINATION ADRS 03A6-7B 669 MOV A,E ;GET MERGED HEX CHARS 03A7-A2 670 ANA D ;CLEAR MS HEX CHAR 03A8-77 671 MOV M,A ;STORE LS HEX CHAR 03A9-C9 672 RET 03AA- 673 ; 03AA- 674 ;DECREMENTS MEMORY ADRS 03AA- 675 ; 03AA-0B 676 DCRM: DCX B ;POINT TO NEXT LOWER ADRS 03AB-E1 677 POP H ;UNDO STACK CALL 03AC-C3 64 03 678 JMP FETA3 ;TO FETCH NEW ADRS DATA 03AF- 679 ; 03AF- 680 ;STORES DATA IN MEM AND INCREMENTS ADRS 03AF- 681 ; 03AF-D1 682 STRM: POP D ;UNDO STACK CALL 03B0-CD 93 03 683 CALL FETA6 ;MERGE 2 HEX DATA VALUES INTO A 03B3-5F 684 MOV E,A ;SAVE IN E 03B4-02 685 STAX B ;STORE DATA BYTE IN RAM ADRS IN B 03B5-0A 686 LDAX B ;READ IT BACK 03B6-BB 687 CMP E ;IS IT THE SAME? DID IT STORE? 03B7-03 688 INX B ;POINT TO NEXT RAM ADRS 03B8-CA 64 03 689 JZ FETA3 ;FETCH NEW ADRS IF LAST STORE OK 03BB-0B 690 DCX B ;ELSE POINT BACK TO LAST RAM ADRS 03BC-C5 691 PUSH B ;SAVE THIS ADRS 03BD-D7 692 RST 2 ;BEEP A FAIL TO STORE ERROR 03BE-C1 693 POP B ;RESTORE RAM ADRS 03BF-C3 64 03 694 JMP FETA3 ;AND FETCH IT AGAIN 03C2- 695 ; 03C2- 696 ;RUNS THE PROGRAM STARTING AT ADRS IN DISPLAY 03C2- 697 ; 03C2-21 32 01 698 RUN: LXI H,$0132 ;INSTR CODES FOR STA 01XX (RUN) 03C5-22 D5 0B 699 RUN1: SHLD RAML1 ;JUMP LINK IN RAM 03C8-21 10 C3 700 LXI H,$C310 ;INSTR CODES OF 00 AND JMP XXXX 03CB-22 D7 0B 701 SHLD RAML2 ;JUMP LINK IN RAM 03CE-31 DB 0B 702 LXI SP,SAVIM ;USER PROG START ADRS LINK+1 03D1-C5 703 PUSH B ;STORE USER START ADRS IN RAM LINK 03D2-21 DF 0B 704 LXI H,SAVSH ;RAM ADRS OF MSBYTE 03D5-36 0B 705 MVI M,$0B ;MSBYTE USER SP 03D7-2B 706 DCX H ;RAM ADRS OF LSBYTE USER SP 03D8-7E 707 MOV A,M ;LSBYTE USER SP 03D9-FE 40 708 CPI $40 ;<= 40 03DB-D2 E0 03 709 JNC RUN2 ;IF AVAIL STACK SPACE 03DE-36 B0 710 MVI M,$B0 ;IF NOT, RESET POINTER 03E0-31 E2 0B 711 RUN2: LXI SP,SAVE ;PREPARE TO RESTORE USER REGS 03E3-D1 712 POP D ;RESTORE D,E 03E4-C1 713 POP B ;RESTORE B,L 03E5-F1 714 POP PSW ;RESOTRE PSW,A 03E6-31 DE 0B 715 LXI SP,SAVSL ;RAM ADRS OF USER SP 03E9-E1 716 POP H ;PUT SPH,L IN H,L 03EA-F9 717 SPHL ;TRANSFER SP VAL TO CPU SP 03EB-2A E0 0B 718 LHLD SAVL ;RESTORE H,L 03EE-C3 D5 0B 719 JMP RAML1 ;LINK TO USER PROGRAM 03F1- 720 ; 03F1- 721 ;INSTRUCTION SINGLE STEP AND RETURN TO MONITOR 03F1- 722 ; 03F1-21 32 06 723 INSS: LXI H,$0632 ;INSTR CODES FOR STA 06XX (INSS) 03F4-C3 C5 03 724 JMP RUN1 ;SET LINKS,RESTORE REGS,USER PROG 03F7- 725 ; 03F7- 726 ;HARDWARE SINGLE STEP ONE LINE OF CODE 03F7- 727 ; 03F7-21 32 03 728 HDSS: LXI H,$0332 ;INSTR CODES FOR STA 03XX (HDSS) 03FA-C3 C5 03 729 JMP RUN1 ;SET LINKS,RESTORE REGS,USER PROG 03FD- 730 ; 03FD- 731 ;DECREMENTS REGISTER DISPLAYED 03FD- 732 ; 03FD-D1 733 DCRR: POP D ;UNDO STACK CALL 03FE-03 734 INX B ;POINT TO LAST SAVX REG RAM ADRS 03FF-2A F8 0B 735 LHLD RMP ;REGISTER MESSAGE POINTER 0402-2B 736 DCX H ;SUBTRACT 2 FROM IT 0403-2B 737 DCX H ; 0404-3E E8 738 MVI A,$E8 ;LS BYTE OF SAVA+1 ADRS IN RAM 0406-B9 739 CMP C ;SEE IF IT'S IM REG 0407-C2 DC 02 740 JNZ FETR1 ;FETCH NEW NON-IM REG+DISP IF NOT 040A-01 DB 0B 741 LXI B,SAVIM ;ADRS OF IM VALUE IN RAM 040D-21 7D 02 742 LXI H,IM ;ADRS OF IM DISP MESSAGE 0410-C3 DC 02 743 JMP FETR1 ;FETCH IM REG + DISP IF IT IS IM 0413- 744 ; 0413- 745 ;STORES REGISTER DATA AND INCREMENTS 0413- 746 ; 0413-D1 747 STRR: POP D ;UNDO STACK CALL 0414-CD 93 03 748 CALL FETA6 ;MERGE 2 HEX DATA VALUES IN A 0417-02 749 STAX B ;STORE DATA BYTE IN SAVX REG ADRS 0418-0B 750 DCX B ;POINT TO NEXT SAVX REG ADRS 0419-2A F8 0B 751 LHLD RMP ;REGISTER MESSAGE POINTER 041C-23 752 INX H ;POINT TO NEXT REG MESSAGE 041D-23 753 INX H ; 041E-23 754 INX H ; 041F-23 755 INX H ; 0420-3E DA 756 MVI A,$DA ;LS BYTE OF SAVIM-1 ADRS IN RAM 0422-B9 757 CMP C ;SEE IF IT'S A REG 0423-CA D5 02 758 JZ FETR ;FETCH A REG + DISP IF IT IS 0426-C3 DE 02 759 JMP FETR2 ;FETCH NEX REG + DISP IF NOT 0429- 760 ; 0429- 761 ;DELAYS APPROX 1MS 0429- 762 ; 0429-C5 763 DELA: PUSH B 042A-01 01 00 764 LXI B,$0001 ;FIXED 1MS VALUE 042D-C3 31 04 765 JMP DEL1 ;START TIMIMG LOOP 0430- 766 ; 0430- 767 ;DELAYS APPROX 1MS TIMES VALUE IN BC 0430- 768 ; 0430-C5 769 DELB: PUSH B 0431-F5 770 DEL1: PUSH PSW 0432-AF 771 XRA A ;CLEAR A 0433-D5 772 PUSH D ; 0434-16 8C 773 DEL2: MVI D,TIME ;1MS SMALL LOOP TIME CONSTANT 0436-15 774 DEL3: DCR D ;1MS LOOP 0437-C2 36 04 775 JNZ DEL3 ;IF NOT 1MS WORTH OF COUNTS 043A-0B 776 DCX B ;LARGE LOOP COUNTER 043B-B8 777 CMP B ;MS BYTE =0? 043C-C2 34 04 778 JNZ DEL2 ;IF NOT, LOOP FOR 1 MORE MS 043F-B9 779 CMP C ;LS BYTE =0? 0440-C2 34 04 780 JNZ DEL2 ;IF NOT, LOOP 0443-D1 781 POP D ;WHEN DONE 0444-F1 782 POP PSW 0445-C1 783 POP B 0446-C9 784 RET 0447- 785 ; 0447- 786 ;BEEP PRODUCES A FIXED TONE FREQ. + DURATION 0447- 787 ; 0447-2E FF 788 BEEP2: MVI L,$FF ;DURATION MULTIPLIER 0449-26 00 789 MVI H,$00 ;SPEAKER FLAG 044B-48 790 MOV C,B ;SET COUNT REG B 044C-5A 791 MOV E,D ;SET COUNT REG E 044D-E5 792 PUSH H ;INIT. DONE FLAG 044E-0D 793 BEEP3: DCR C ;DECR FREQ 044F-C2 80 04 794 JNZ BEEP8 ; 0452-48 795 MOV C,B ;RESTORE FREQ 0453-7C 796 MOV A,H ;CHG SPKR FLAG 0454-2F 797 CMA ; 0455-B7 798 ORA A ; 0456-67 799 MOV H,A ; 0457-C2 60 04 800 JNZ BEEP4 ;TEST SPKR FLAG 045A-3E C0 801 MVI A,$C0 ;TURN SPKR OFF 045C-30 802 SIM ; 045D-C3 64 04 803 JMP BEEP5 ; 0460-3E 40 804 BEEP4: MVI A,$40 ;TURN SPKR ON 0462-30 805 SIM ; 0463-BE 806 CMP M ;TIME DELAY INSTR 0464-F1 807 BEEP5: POP PSW ;GET DONE FLAG 0465-F5 808 PUSH PSW ; 0466-B7 809 ORA A ; 0467-CA 6F 04 810 JZ BEEP6 ;CONTINUE IF NOT DONE 046A-7C 811 MOV A,H ;RETURN IF SPKR OFF 046B-B7 812 ORA A ; 046C-CA 7E 04 813 JZ BEEP7 ; 046F-1D 814 BEEP6: DCR E ;DURATION CNTR 0470-C2 88 04 815 JNZ BEEP9 ; 0473-5A 816 MOV E,D ;RESTORE DURATION 0474-2D 817 DCR L ;TIME COUNT 0475-C2 4E 04 818 JNZ BEEP3 ; 0478-F1 819 POP PSW ;GET DONE FLAG 0479-2F 820 CMA ; 047A-F5 821 PUSH PSW ;SET DONE FLAG 047B-C3 4E 04 822 JMP BEEP3 ; 047E-F1 823 BEEP7: POP PSW ; 047F-C9 824 RET ; 0480-E3 825 BEEP8: XTHL ;DELAY 81 CYCLES 0481-E3 826 XTHL ; 0482-E3 827 XTHL ; 0483-E3 828 XTHL ; 0484-BE 829 CMP M ; 0485-C3 6F 04 830 JMP BEEP6 ; 0488-00 831 BEEP9: NOP ;DELAY 14 CYCLES 0489-00 832 NOP ; 048A-C3 4E 04 833 JMP BEEP3 ; 048D- 834 ; 048D- 835 ;SIGNATURE ANALYSYS TEST LOOP 048D- 836 ; 048D-F3 837 SATL1: DI ;TURN OFF INTERRUPTS 048E-DB 80 838 IN $80 ;PULSE A15 READ START-STOP LINE 0490-D3 80 839 OUT $80 ;PULSE A15 WRITE START-STOP LINE 0492-31 CE 0B 840 LXI SP,$0BCE ;SET TO MONITOR VALUE 0495- 841 ; 0495- 842 ;RAM PROTECT TEST 0495- 843 ; 0495-D3 11 844 OUT $11 ;SET RAM PROTECT 0497-32 11 0B 845 STA $0B11 ;WRITE TO UNPROTECTED RAM 049A-32 11 09 846 STA $0911 ;WRITE TO PROTECTED RAM 049D-D3 10 847 OUT $10 ;UNPROTECT RAM 049F- 848 ; 049F- 849 ;OUTPUT PORT TEST 049F- 850 ; 049F-AF 851 XRA A ;CLEAR A 04A0-37 852 STC ;SET CARRY BIT TO 1 FOR 8 LOOPS 04A1-17 853 SATL2: RAL ;MOVE 1 BIT TO LEFT 04A2-D3 30 854 OUT LOUT ;OUTPUT PORT LEDS 04A4-D2 A1 04 855 JNC SATL2 ;IF NOT DONE 04A7- 856 ; 04A7- 857 ;DISPLAY LATCH TEST 04A7- 858 ; 04A7-17 859 SATL3: RAL ;MOVE 1 BIT TO LEFT 04A8-D3 38 860 OUT DSP ;OUTPUT DISPLAY SEGMENTS 04AA-D2 A7 04 861 JNC SATL3 ;IF NOT DONE 04AD- 862 ; 04AD- 863 ;SCAN LATCH TEST 04AD- 864 ; 04AD-2F 865 CMA ;SET A TO FF 04AE-3F 866 CMC ;CLEAR CARRY 04AF-17 867 SATL4: RAL ;MOVE 0 BIT TO LEFT 04B0-D3 28 868 OUT SCAN ;OUTPUT SCAN LINES 04B2-CD 29 04 869 CALL DELA ;STRETCH EACH DISP DIGIT 04B5-DA AF 04 870 JC SATL4 ;IF NOT DONE 04B8- 871 ; 04B8- 872 ;SPEAKER SERIAL OUT TEST 04B8- 873 ; 04B8-3E 40 874 MVI A,$40 ;SPEAKER ON MASK 04BA-30 875 SIM ;TURN SPKR ON 04BB-3E C0 876 MVI A,$C0 ;SPKR OFF MASK 04BD-30 877 SIM ;TURN SPKR OFF 04BE- 878 ; 04BE- 879 ;KEY INPUT TEST 04BE- 880 ; 04BE-AF 881 XRA A ;CLEAR A 04BF-D3 28 882 OUT SCAN ;ALL SCAN LINES TO LOGIC 0 04C1-DB 18 883 IN KEY ;RESPOND TO ALL KEYS 04C3- 884 ; 04C3- 885 ;INPUT PORT TEST 04C3- 886 ; 04C3-DB 20 887 IN SIN ;INPUT THE INPUT SWITCHES 04C5- 888 ; 04C5- 889 ;INTERRUPT KEY TEST 04C5- 890 ; 04C5-21 10 00 891 LXI H,BEEP ;ADRS OF BEEP ROUTINE 04C8-22 FD 0A 892 SHLD $0AFD ;STORE IT IN INTRPT RAM LINK 6.5 04CB-3E C3 893 MVI A,$C3 ;JUMP OP CODE 04CD-32 FC 0A 894 STA $0AFC ;STORE IT IN INTRPT RAM LINK 6.5 04D0-3E 1D 895 MVI A,$1D ;INTRPT MASK FOR RST 6.5 04D2-30 896 SIM ;SET MASK 04D3-FB 897 EI ;ENABLE INTERRUPTS 04D4-C3 8D 04 898 JMP SATL1 ;LOOP BACK TO START OVER AGAIN 04D7- 899 ; 04D7- 900 ;PRESENTS INPUT SWITCH DATA ON OUTPUT LEDS 04D7- 901 ; 04D7-3A 00 20 902 ECHO: LDA $2000 ;READ INPUT PORT SWITCHES 04DA-32 00 30 903 STA $3000 ;WRITE TO OUTPUT PORT LEDS 04DD-C3 D7 04 904 JMP ECHO ;REPEAT 04E0- 905 ; 04E0- 906 ;AND GATE PROGRAM 04E0- 907 ; 04E0-3A 00 20 908 ANDGT: LDA $2000 ;READ INPUT PORT 04E3-FE FF 909 CPI $FF 04E5-CA F0 04 910 JZ ON ;JUMP IF ALL BITS ARE ONE 04E8-3E FF 911 MVI A,$FF 04EA-32 00 30 912 STA $3000 ;TURN OUTPUT LEDS OFF 04ED-C3 E0 04 913 JMP ANDGT 04F0-3E FE 914 ON: MVI A,$FE ;TURN LED ON 04F2-32 00 30 915 STA $3000 04F5-C3 E0 04 916 JMP ANDGT 04F8- 917 ; 04F8- 918 ;CONVEYOR BELT CONTROLLER DEMO PROGRAM 04F8- 919 ; 04F8-CD 97 02 920 CONV: CALL BLNK ;BLANK THE DISPLAY 04FB-AF 921 XRA A ;CLEAR A 04FC-32 F0 0B 922 STA UDSP0 ;SET DISPLAY COUNTER 04FF-CD 4B 01 923 LOOP: CALL KIND ;DISPLAY MESSAGE & READ KEYS 0502-FE 00 924 CPI $00 ;CHECK FOR "0" KEY 0504-C2 FF 04 925 JNZ LOOP 0507-21 F0 0B 926 LXI H,NUM ;INCREMENT COUNT 050A-34 927 INR M 050B-7E 928 MOV A,M ;TEST FOR COUNT=10 050C-FE 0A 929 CPI $0A 050E-CA 14 05 930 JZ MOVE 0511-C3 FF 04 931 JMP LOOP 0514-3E 7F 932 MOVE: MVI A,$7F 0516-16 F0 933 MVI D,MIN ;SET LOW FREQ VALUE 0518-32 00 30 934 MLP: STA $3000 ;WRITE DATA TO LEDS 051B-01 50 00 935 LXI B,DTIME ;WATE DELAY TIME 051E-D5 936 PUSH D 051F-CD 30 04 937 CALL DELB 0522-D1 938 POP D 0523-CD 31 05 939 CALL TONE ;GENERATE BEEP 0526-37 940 STC 0527-1F 941 RAR ;SHIFT PATTERN 0528-DA 18 05 942 JC MLP 052B-32 00 30 943 STA $3000 ;TURN OFF LEDS 052E-C3 F8 04 944 JMP CONV 0531-5F 945 TONE: MOV E,A ;SAVE A 0532-D5 946 PUSH D 0533-42 947 MOV B,D 0534-CD 12 00 948 CALL BEEP1 ;GENERATE BEEP 0537-D1 949 POP D 0538-7A 950 MOV A,D ;INCREASE FREQUENCY 0539-D6 10 951 SUI INCR 053B-57 952 MOV D,A 053C-7B 953 MOV A,E ;RESTORE A 053D-C9 954 RET 0BF0- 955 NUM .EQ $0BF0 ;RAM BUFFER LOCATION 0010- 956 INCR .EQ $10 ;FREQ INCREMENT 00F0- 957 MIN .EQ $F0 ;FEQUENCY MINIMUM 0050- 958 DTIME .EQ 80 ;TIME BETWEEN SHIFTS 053E- 959 ; 053E- 960 ;WELL TEMPERED MICROPROCESSOR 053E- 961 ;GENERATES PSEUDO RANDOM TONES FROM ROM 053E- 962 ; 053E-21 80 01 963 WTM: LXI H,$0180 ;SET ROM POINTER TO 0180 0541-7E 964 WTM1: MOV A,M ;ROM CONTENTS 0542-E6 7E 965 ANI $7E ;MASK BITS 0544-47 966 MOV B,A ;SET BEEP FREQ. REG 0545-E5 967 PUSH H ;SAVE ADRS POINTER 0546-CD 12 00 968 CALL BEEP1 ;GENERATE BEEP 0549-E1 969 POP H ;RESTORE ADRS POINTER 054A-01 50 00 970 LXI B,$0050 ;SET DELAY REG 054D-CD 30 04 971 CALL DELB ;PAUSE 0550-23 972 INX H ;NEXT ADRS OF ROM 0551-3E 03 973 MVI A,$03 ;LAST ADRS OF LOOP 0553-BC 974 CMP H ;LAST ADRS 0554-CA 3E 05 975 JZ WTM ;IF LAST ADRS 0557-C3 41 05 976 JMP WTM1 ;IF NOT LAST ADRS 055A- 977 ; 055A- 978 ;SQUIRREL FEEDBACK SHIFT REGISTER DISPLAY 055A- 979 ; 055A-CD 97 02 980 SQRL: CALL BLNK ;CLEAR THE DISPLAY 055D-AF 981 XRA A ;CLEAR A AND CARRY 055E-06 01 982 MVI B,$01 ;SEED 0560-17 983 SQRL1: RAL ;SHIFT A A7 TO CARRY 0561-57 984 MOV D,A ;SAVE IT 0562-78 985 MOV A,B ;GET B FSR REGISTER 0563-1F 986 RAR ;SHIFT A7 INTO B7 0564-4F 987 MOV C,A ;SAVE IT 0565-A8 988 XRA B ;XOR B0 AND B1 0566-E6 01 989 ANI $01 ;SET B7 TO B1 TO 0 0568-B2 990 ORA D ;INSERT B0 XOR B1 IN A0 0569-41 991 MOV B,C ;RESTORE NEW B 056A-21 FC 0B 992 LXI H,DDSP2 ;ADRS OF DECODED DISPALY D2 056D-F5 993 PUSH PSW ;SAVE A FSR REG 056E-0F 994 RRC ;GET DIGIT 2 BITS IN POSITION 056F-0F 995 RRC ; 0570-CD 86 05 996 CALL SQRL3 ;FORMAT AND STORE DIGITS 2,3 0573-2C 997 INR L ;ADRS DIGIT 4 0574-78 998 MOV A,B ;GET B FSR REGISTER 0575-07 999 RLC ;GET DIGIT 4 BITS IN POSITION 0576-CD 86 05 1000 CALL SQRL3 ;FORMAT AND STORE IN DIGITS 4,5 0579-0E 0F 1001 MVI C,$0F ;DISPLAY TIMER SEGMENTS 057B-CD C8 01 1002 SQRL2: CALL SDS ;DISPLAY SEGMENTS 057E-0D 1003 DCR C ;DCR TIMER 057F-C2 7B 05 1004 JNZ SQRL2 ;IF TIME NOT UP 0582-F1 1005 POP PSW ;RESTORE A FSR REGISTER 0583-C3 60 05 1006 JMP SQRL1 ;DO IT AGAIN 0586-4F 1007 SQRL3: MOV C,A ;SAVE SHIFTED VALUE 0587-F6 F0 1008 ORI $F0 ;BLANK E,F,G,DP SEGS 0589-77 1009 MOV M,A ;STORE IN DIG 2 OR 4 058A-79 1010 MOV A,C ;RECALL SHIFTED VALUE 058B-2C 1011 INR L ;ADRS OF DIG 3,5 058C-07 1012 RLC ;GET A SEG IN D0 058D-E6 01 1013 ANI $01 ;CLEAR D7-D1 058F-57 1014 MOV D,A ;SAVE A SEG 0590-79 1015 MOV A,C ;RECALL SHIFTED VALUE 0591-0F 1016 RRC ;MOVE A,F,E,D TO D6-D3 0592-E6 38 1017 ANI $38 ;CLEAR D7-D6,D2-D0 0594-B2 1018 ORA D ;INSERT A SEG IN D0 0595-F6 C6 1019 ORI $C6 ;BLANK B,C,H,DP SEGS 0597-77 1020 MOV M,A ;STORE DIG 3 OR 5 0598-C9 1021 RET 0599- 1022 ; 0599- 1023 ;ORGAN GENERATES TONES FROM KEYBOARD 0599- 1024 ; 0599-16 40 1025 ORGAN: MVI D,$40 ;INITIALIZE SPKR FLAG 059B-CD 9A 01 1026 ORGAN1: CALL KRD ;READ KEYS 059E-CD BB 05 1027 CALL CODE ;DECODE KEYS & LOK-UP DELAY VALUE 05A1-B7 1028 ORA A ;CHECK FOR NO KEY 05A2-CA 9B 05 1029 JZ ORGAN1 05A5-CD AE 05 1030 CALL DLY ;TIME DELAY 05A8-CD B5 05 1031 CALL SPKR ;CHANGE SPEAKER STATE 05AB-C3 9B 05 1032 JMP ORGAN1 ;REPEAT 05AE- 1033 ; 05AE- 1034 ;DELAY ROUTINE 05AE- 1035 ; 05AE-3D 1036 DLY: DCR A ;DECREMENT A UNTIL ZERO 05AF-00 1037 NOP 05B0-00 1038 NOP 05B1-C2 AE 05 1039 JNZ DLY 05B4-C9 1040 RET 05B5- 1041 ; 05B5- 1042 ;SPKR ROUTINE TO CHANGE SPEAKER STATE 05B5- 1043 ; 05B5-7A 1044 SPKR: MOV A,D ;GET SPKR FLAG 05B6-EE 80 1045 XRI $80 ;COMPLEMENT BIT 7 05B8-57 1046 MOV D,A ;SAVE FLAG 05B9-30 1047 SIM ;OUTPUT TO SPKR 05BA-C9 1048 RET 05BB- 1049 ; 05BB- 1050 ;CODE ROUTINE DETERMINES WHICH KEY IS 05BB- 1051 ; PRESSED AND LOOKS UP DELAY VALUE 05BB- 1052 ; 05BB-06 07 1053 CODE: MVI B,$07 ;INITIALIZE ROW COUNT 05BD-21 EF 0B 1054 LXI H,$0BEF ;INITIALIZE DATA ADDRESS 05C0-7E 1055 READ: MOV A,M ;GET KEY DATA 05C1-2F 1056 CMA 05C2-B7 1057 ORA A ;ANY KEY PRESSED? 05C3-CA D8 05 1058 JZ NOKEY 05C6-FE 04 1059 CPI $04 ;DATA=100? 05C8-C2 CC 05 1060 JNZ SHIFT ;IF YES CHANGE TO 011 05CB-3D 1061 DCR A 05CC-4F 1062 SHIFT: MOV C,A ;SAVE KEY DATA 05CD-78 1063 MOV A,B ;SHIFT ROW COUNT 05CE-07 1064 RLC 05CF-07 1065 RLC 05D0-B1 1066 ORA C ;COMBINE ROW COUNT & DATA 05D1-21 D9 05 1067 LXI H,TABLE-9 ;SET LOOK-UP ADDRESS 05D4-85 1068 ADD L 05D5-6F 1069 MOV L,A 05D6-7E 1070 MOV A,M ;GET DELAY VALUE 05D7-C9 1071 RET 05D8-05 1072 NOKEY: DCR B ;NO KEY PRESSED-GO TO NEXT ROW 05D9-2B 1073 DCX H 05DA-78 1074 MOV A,B ;DONE? 05DB-FE 01 1075 CPI $01 05DD-C2 C0 05 1076 JNZ READ ;IF NOT, READ NEXT ROW 05E0-AF 1077 XRA A ;NO KEY - SET DELAY TO 0 05E1-C9 1078 RET 05E2- 1079 ; 05E2- 1080 ;LOOK-UP TABEL FOR ORGAN DELAY VALUES 05E2- 1081 ; 05E2-E6 1082 TABLE: .DB $E6 ;E3 05E3-00 1083 .DB $00 05E4-00 1084 .DB $00 05E5-00 1085 .DB $00 05E6-DA 1086 .DB $DA ;F3 05E7-BD 1087 .DB $BD ;G3 05E8-A3 1088 .DB $A3 ;A3 05E9-00 1089 .DB $00 05EA-8F 1090 .DB $8F ;B3 05EB-85 1091 .DB $85 ;C4 05EC-72 1092 .DB $72 ;D4 05ED-00 1093 .DB $00 05EE-64 1094 .DB $64 ;E4 05EF-5C 1095 .DB $5C ;F4 05F0-4D 1096 .DB $4D ;G4 05F1-00 1097 .DB $00 05F2-43 1098 .DB $43 ;A4 05F3-38 1099 .DB $38 ;B4 05F4-33 1100 .DB $33 ;C5 05F5-00 1101 .DB $00 05F6-2D 1102 .DB $2D ;D5 05F7-24 1103 .DB $24 ;E5 05F8-20 1104 .DB $20 ;F5 05F9- 1105 ; 05F9- 1106 ;ROCKET BLAST-OFF DEMO PROGRAM 05F9- 1107 ; 05F9-3E AA 1108 ROCT: MVI A,$AA ;ALL AMBER LED MASK 05FB-D3 30 1109 OUT LOUT ;TURN ON AMBER LEDS 05FD-11 5C 06 1110 LXI D,ROCM ;ROCKET DISPLAY MESSAGE 0600-DF 1111 RST 3 ;STORE MESSAGE IN RAM 0601-06 80 1112 ROCT1: MVI B,$80 ;1 SECOND DELAY LOOP COUNTER 0603-CD E9 01 1113 ROCT2: CALL DCD ;UPDATE DISPLAY 0606-05 1114 DCR B ;COUNTER 0607-C2 03 06 1115 JNZ ROCT2 ;REPEAT IF <1 SECOND 060A-D7 1116 RST 2 ;BEEP 060B-21 F0 0B 1117 LXI H,UDSP0 ;COUNT DOWN SECONDS DIGIT 060E-35 1118 DCR M ;INCREMENT IT 060F-C2 01 06 1119 JNZ ROCT1 ;IF NOT LAST COUNT (0 SECONDS) 0612-06 00 1120 MVI B,$00 ;START BLAST-OFF FREQUENCY 0614-16 02 1121 MVI D,$02 ;START BLAST-OFF DURATION 0616-3E E7 1122 ROCT3: MVI A,$E7 ;LED PATTERN 0618-CD 55 06 1123 CALL ROCT5 ;SEQUENCE 061B-3E DB 1124 MVI A,$DB ;LED PATTERN 061D-CD 55 06 1125 CALL ROCT5 ;SEQUENCE 0620-3E BD 1126 MVI A,$BD ;LED PATTERN 0622-CD 55 06 1127 CALL ROCT5 ;SEQUENCE 0625-3E 7E 1128 MVI A,$7E ;LED PATTERN 0627-CD 55 06 1129 CALL ROCT5 ;SEQUENCE 062A-C2 16 06 1130 JNZ ROCT3 ;REPEATE IF B70, FREQ