Added rudimentary keyboard polling
This commit is contained in:
13
src/example/char_in.asm
Normal file
13
src/example/char_in.asm
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
10;Queries the keyboard for input and prints the resulting keycode
|
||||||
|
20 ORG 100H ;Tell the assembler to start at addr 0x100
|
||||||
|
30START: LD HL,GREET ;Load the start addr. of the banner text
|
||||||
|
40 LD B,15H ;The length if the string
|
||||||
|
50 LD DE,0H ;Start output in the top left corner
|
||||||
|
60 CALL 84CDH ;Call str_out
|
||||||
|
70LOOP: CALL 8881H ;Call the char_in
|
||||||
|
80 LD DE,16H ;Position cursor in row 0, col 22
|
||||||
|
90 CALL 8468H ;Print the char
|
||||||
|
100 JR LOOP ;Retrun to the loop
|
||||||
|
110 RET ;End the program
|
||||||
|
120GREET: DB 'Test keyboard input: '
|
||||||
|
130 END ;Mark the end of code for the assembler
|
||||||
Reference in New Issue
Block a user