Prev: 63236 Up: Map Next: 63293
63262: Read Control Sinclair
Control mode 3: reads keyboard ports 63486 and 61438 four times, extracting one direction or fire bit from each read.
Read_Control_Sinclair 63262 LD BC,63486 Read from the keyboard;
Port Number Bit
0 1 2 3 4
247 1 2 3 4 5
63265 IN A,(C)
63267 OR %11101111 Isolate bit 4 from the first row.
63269 LD E,A Save the masked result.
63270 LD B,239 Read from the keyboard;
Port Number Bit
0 1 2 3 4
239 0 9 8 7 6
63272 IN A,(C)
63274 OR %11111110 Isolate bit 0 from the second row.
63276 AND E Merge with and save the accumulated result.
63277 LD E,A
63278 IN A,(C) Read from the keyboard;
Port Number Bit
0 1 2 3 4
239 0 9 8 7 6
63280 OR %11100111 Isolate bits 3 and 4 from this read.
63282 RRCA Shift the isolated bits into position.
63283 RRCA
63284 AND E Merge with and save the accumulated result.
63285 LD E,A
63286 IN A,(C) Read from the keyboard;
Port Number Bit
0 1 2 3 4
239 0 9 8 7 6
63288 OR %11111011 Isolate bit 2 from this read.
63290 RLCA Shift into position and merge with the accumulated result.
63291 AND E
63292 RET Return to Read_Control_Input_Return.
Prev: 63236 Up: Map Next: 63293