Add KIM-1 functions to write to the 7-segment LED display and get
keypresses from the keypad. Includes sample program illustrating how to use them. Tested on real KIM-1 hardware.
This commit is contained in:
18
libsrc/kim1/getkey.s
Normal file
18
libsrc/kim1/getkey.s
Normal file
@@ -0,0 +1,18 @@
|
||||
;
|
||||
; int __fastcall__ getkey();
|
||||
;
|
||||
|
||||
.include "kim1.inc"
|
||||
|
||||
.import popa
|
||||
|
||||
.export _getkey
|
||||
|
||||
.proc _getkey
|
||||
|
||||
jsr KEYIN ; Open up keyboard channel
|
||||
jsr GETKEY ; Get key code
|
||||
ldx #0 ; MSB of return value is zero
|
||||
rts
|
||||
|
||||
.endproc
|
||||
21
libsrc/kim1/scandisplay.s
Normal file
21
libsrc/kim1/scandisplay.s
Normal file
@@ -0,0 +1,21 @@
|
||||
;
|
||||
; void __fastcall__ scandisplay(unsigned char left, unsigned char middle, unsigned char right);
|
||||
;
|
||||
|
||||
.include "kim1.inc"
|
||||
|
||||
.import popa
|
||||
|
||||
.export _scandisplay
|
||||
|
||||
.proc _scandisplay
|
||||
|
||||
sta $F9 ; Rightmost display data
|
||||
jsr popa
|
||||
sta $FA ; Middle display data
|
||||
jsr popa
|
||||
sta $FB ; Leftmost display data
|
||||
jsr SCANDS
|
||||
rts
|
||||
|
||||
.endproc
|
||||
Reference in New Issue
Block a user