Reset the stdin console when a program starts.
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.export _read
|
.export _read
|
||||||
|
.constructor initstdin
|
||||||
|
|
||||||
.import popax
|
.import popax
|
||||||
.importzp ptr1, ptr2, ptr3
|
.importzp ptr1, ptr2, ptr3
|
||||||
@@ -63,8 +64,22 @@ L9: lda ptr3
|
|||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
.data
|
|
||||||
|
;--------------------------------------------------------------------------
|
||||||
|
; initstdin: Reset the stdin console.
|
||||||
|
|
||||||
|
.segment "INIT"
|
||||||
|
|
||||||
|
initstdin:
|
||||||
|
ldx #<-1
|
||||||
|
stx text_count
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
text_count:
|
text_count:
|
||||||
.byte <-1
|
.res 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user