mirror of
https://github.com/cc65/cc65.git
synced 2025-01-28 15:31:18 +00:00
14f2349ea1
git-svn-id: svn://svn.cc65.org/cc65/trunk@913 b7a2c559-68d2-44c3-8de9-860c34a00d81
39 lines
664 B
ArmAsm
39 lines
664 B
ArmAsm
;
|
|
; Ullrich von Bassewitz, 06.08.1998
|
|
;
|
|
; char cgetc (void);
|
|
;
|
|
|
|
.export _cgetc
|
|
.import plot, write_crtc
|
|
.import cursor
|
|
|
|
.include "zeropage.inc"
|
|
.include "page3.inc"
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
.proc _cgetc
|
|
|
|
L1: lda KeyIndex
|
|
beq L1
|
|
|
|
L2: ldx #$00 ; Get index
|
|
ldy KeyBuf ; Get first character in the buffer
|
|
sei
|
|
L3: lda KeyBuf+1,x ; Move up the remaining chars
|
|
sta KeyBuf,x
|
|
inx
|
|
cpx KeyIndex
|
|
bne L3
|
|
dec KeyIndex
|
|
cli
|
|
|
|
ldx #$00 ; High byte
|
|
tya ; First char from buffer
|
|
rts
|
|
|
|
.endproc
|
|
|