mirror of
https://github.com/cc65/cc65.git
synced 2025-01-28 15:31:18 +00:00
Now getchar works
This commit is contained in:
parent
5f145542b0
commit
1fc16cb9ed
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
|
.include "fcntl.inc"
|
||||||
|
|
||||||
;int read (int fd, void* buf, unsigned count);
|
;int read (int fd, void* buf, unsigned count);
|
||||||
|
|
||||||
@ -21,8 +22,19 @@
|
|||||||
sta ptr2 ; in order to calculate nb of bytes read
|
sta ptr2 ; in order to calculate nb of bytes read
|
||||||
stx ptr2+1 ;
|
stx ptr2+1 ;
|
||||||
|
|
||||||
; jsr popax ; fp pointer don't care in this version
|
jsr popax ; fp pointer don't care in this version
|
||||||
|
cpx #$00
|
||||||
|
bne @is_not_stdin
|
||||||
|
cmp #STDIN_FILENO
|
||||||
|
bne @is_not_stdin
|
||||||
|
; stdin
|
||||||
|
@L1:
|
||||||
|
BRK_TELEMON XRD0 ; waits until key is pressed
|
||||||
|
bcs @L1
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
@is_not_stdin:
|
||||||
lda ptr1 ;
|
lda ptr1 ;
|
||||||
ldy ptr1+1 ;
|
ldy ptr1+1 ;
|
||||||
BRK_TELEMON XFREAD ; calls telemon30 routine
|
BRK_TELEMON XFREAD ; calls telemon30 routine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user