PRINT LD HL,(CHANS) LD DE,15 ADD HL,DE LD (HL),LSB_PRTRT INC HL LD (HL),MSB_PRTRT INC HL LD (HL),LSB_PRTIN INC HL LD (HL),MSB_PRTIN XOR A LD (TOKEN),A RET PRTRT PUSH AF LOOP IN A,(251) FAULT BIT 4,A JR Z,OUT_P RST ERROR DEFB 27 ; ERROR S OUT_P BIT 5,A JR Z,BUSY RST ERROR DEFB 28 ; ERROR T BUSY BIT 7,A JR Z,START CALL BREAK JR LOOP BREAK LD A,#7F IN A,(#FE) RRA RET C LD A,#FE RRA RET C LD HL,10000 LP DEC HL LD A,H OR L JR NZ,LP LD A,13 OUT (251),A RST ERROR DEFB 20 ; BREAK START POP AF CP 32 JR NC,PRR1 CP 8 JR C,TKN CP 14 JR C,TKN JR PRT TKN LD B,A LD A,(TOKEN) OR A RET Z LD A,B PRR1 CP 165 JR C,PRT LD B,A LD A,(TOKEN) OR A JR NZ,PRT LD A,B SUB 165 LD H,0 LD L,A ADD HL,HL CC1 LD DE,OFFTAB ADD HL,DE LD E,(HL) INC HL LD D,(HL) LD HL,150 ADD HL,DE LD A,32 CC2 CALL PRT P1 LD A,(HL) BIT 7,A JR NZ,LAST CC3 CALL PRT INC HL JR P1 LAST RES 7,A CC4 CALL PRT LD A,32 PRT OUT (251),A RET OFFTAB DEFWs 0009000B000D00120019 001D001F00220026002A 002D0030003300360039 003C003F004200440047 004A004D005000530057 0059005C006000640067 006A006C006F00710073 00750079007D007F0083 0089008C00920096009B 00A100A800AD00B300B7 00BD00C000C500CA00D0 00D700DB00DE00E400E9 00ED00F100F500FC00FF 0105010D011001130116 011B01210126012A012E 01310136013A013E0143 0147014A014E01570159 015C01600165016B0100 00000000000000000000 PRTIN RST ERROR DEFB 23 ; INVALID STREAM TOKEN EQU 5BFF