mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-09-27 18:58:34 +00:00
ab975b611c
These are the samples from ORCA/C 2.1.0, converted to LF line endings.
42 lines
1.3 KiB
NASM
42 lines
1.3 KiB
NASM
****************************************************************
|
|
*
|
|
* KeyPress - Check to see if a key has been pressed
|
|
*
|
|
* Outputs:
|
|
* A - 1 (true) if pressed, else 0
|
|
*
|
|
****************************************************************
|
|
*
|
|
KeyPress start
|
|
keyBoard equ $C000 keyboard location
|
|
|
|
sep #$30 use short regs for load
|
|
lda >keyBoard load keyboard value
|
|
asl A shift sign bit into bit 0
|
|
rol A
|
|
rep #$30 back to long regs
|
|
and #1 and out all but the bit we want
|
|
rtl
|
|
end
|
|
|
|
****************************************************************
|
|
*
|
|
* ReadChar - return the last character typed on the keyboard
|
|
*
|
|
* Outputs:
|
|
* A - character typed
|
|
*
|
|
****************************************************************
|
|
*
|
|
ReadChar start
|
|
keyBoard equ $C000 keyboard location
|
|
strobe equ $C010 strobe location
|
|
|
|
sep #$30 use short regs
|
|
sta >strobe clear strobe
|
|
lda >keyBoard load character
|
|
rep #$30 back to long regs
|
|
and #$007F and out high bits
|
|
rtl
|
|
end
|