TS-440s Controller Assembler

Kenwood TS-440s Driver 1-21-00 TSC ASSEMBLER PAGE 3 111 708A B6 FF00 LDA PIA0AD get keyboard 112 708D 84 7F ANDA #$7F remove joystick data 113 708F 81 7F CMPA #$7F is it still pushed? 114 7091 1027 FF78 LBEQ CHECKD no, can't decode 115 7095 B6 FF22 LDA PIA1BD yes, receive data 116 7098 47 ASRA is there receive data? 117 7099 24 A1 BCC RECDAT yes receive the byte 118 709B 30 1F LEAX -1,X has debounce time finished 119 709D 26 E8 BNE BOUNLP no, wait some more 120 709F 1C AF ANDCC #$AF enable FIRQ & IRQ 121 * 122 * Keyboard key decode 123 70A1 8E 71D9 LDX #KEYBUF point to key code buffer 124 70A4 86 FE LDA #$FE first keyboard strobe position 125 70A6 B7 FF02 STA PIA0BD send first key strobe 126 70A9 4F CLRA starting code 127 70AA 20 08 BRA CHECKY check for key in first column 128 * Next column of keyboard 129 70AC 1A 01 NXTCOL ORCC #1 keep other lines high 130 70AE 79 FF02 ROL PIA0BD finished moving strobe along? 131 70B1 24 1F BCC COLFIN yes, show invalid code 132 70B3 4C INCA no, show next key column 133 70B4 F6 FF00 CHECKY LDB PIA0AD get keyboard data 134 * Search each row of this column 135 70B7 54 SCAN LSRB is this key pushed? 136 70B8 25 02 BCS NXTROW no, next row 137 70BA A7 80 STA ,X+ save this code 138 70BC 34 02 NXTROW PSHS A save current row 139 70BE B6 FF22 LDA PIA1BD get receive data 140 70C1 47 ASRA extract receive data 141 70C2 35 02 PULS A retrieve current row 142 70C4 1024 FF74 LBCC RECDAT is there RD? yes, receive byte 143 70C8 8B 08 ADDA #$08 show next row 144 70CA 81 38 CMPA #$38 done this row? 145 70CC 25 E9 BLO SCAN no, do another row 146 * Restart row search on next column 147 70CE 84 07 ANDA #$07 yes, reset row number 148 70D0 20 DA BRA NXTCOL go to next column 149 * End of keycodes 150 70D2 86 FF COLFIN LDA #$FF invalid key code 151 70D4 A7 84 STA ,X show end of keys 152 * 153 * Convert key code to ASCII 154 70D6 108E 71A1 LDY #KEYTAB point to conversion table 155 70DA FE 71E9 LDU KEYPTR point to keys for output 156 70DD 5F CLRB keyboard table entry position 157 70DE 8E 71D9 KEYOFF LDX #KEYBUF point to key codes 158 70E1 A6 80 BUFNXT LDA ,X+ get key code 159 70E3 81 FF CMPA #$FF end of key table? 160 70E5 27 29 BEQ TABNXT yes 161 70E7 34 02 PSHS A save key code 162 70E9 B6 FF22 LDA PIA1BD get receive data 163 70EC 47 ASRA extract receive data 164 70ED 35 02 PULS A retrieve key code
previous next

Copyright © 2000 Alan Electron. All Rights Reserved.
Coco III TS-440s Controller Issue 2, 29 May 2021
ts-440s.lst Draft Page 3 of 7