From b6fb5e3dfdfec1487290d3ab5a4d1ac901ebc375 Mon Sep 17 00:00:00 2001 From: Jali Date: Sat, 4 Apr 2020 00:00:22 +0200 Subject: [PATCH] Added rudimentary keyboard polling --- src/example/char_in.asm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/example/char_in.asm diff --git a/src/example/char_in.asm b/src/example/char_in.asm new file mode 100644 index 0000000..4fb6497 --- /dev/null +++ b/src/example/char_in.asm @@ -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