]> git.sur5r.net Git - cc65/commitdiff
Reset the stdin console when a program starts. 68/head
authorGreg King <gregdk@users.sf.net>
Tue, 24 Dec 2013 20:26:05 +0000 (15:26 -0500)
committerGreg King <gregdk@users.sf.net>
Tue, 24 Dec 2013 20:26:05 +0000 (15:26 -0500)
libsrc/atmos/read.s

index e6e1f7eeec7595504ff6fae02e55cc757bd29222..443808fa86b526fef4fa5d5c4801fa38e881f6f1 100644 (file)
@@ -7,6 +7,7 @@
 ;
 
         .export         _read
+        .constructor    initstdin
 
         .import         popax
         .importzp       ptr1, ptr2, ptr3
@@ -63,8 +64,22 @@ L9:     lda     ptr3
 
 .endproc
 
-.data
+
+;--------------------------------------------------------------------------
+; initstdin:  Reset the stdin console.
+
+.segment        "INIT"
+
+initstdin:
+        ldx     #<-1
+        stx     text_count
+        rts
+
+
+;--------------------------------------------------------------------------
+
+.bss
 
 text_count:
-        .byte   <-1
+        .res    1