]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm/read.s
Removed .import for std kernal entries. Added .include "cbm.inc"
[cc65] / libsrc / cbm / read.s
index aa692a34aed09f120c263647c85e3dc25e7b20d9..ee01596aa6ada0881eabfb0905d4cc7eeb76e252 100644 (file)
@@ -8,7 +8,6 @@
         .export         _read
         .constructor    initstdin
 
-        .import         SETLFS, OPEN, CHKIN, BASIN, CLRCH, BSOUT, READST
         .import         rwcommon
         .import         popax
         .importzp       ptr1, ptr2, ptr3, tmp1, tmp2, tmp3
 ;--------------------------------------------------------------------------
 ; initstdin: Open the stdin file descriptors for the keyboard
 
-.segment        "INIT"
+.segment        "ONCE"
 
 .proc   initstdin
 
-        lda     #LFN_READ
-        sta     fdtab+STDIN_FILENO
         lda     #STDIN_FILENO + LFN_OFFS
         ldx     #CBMDEV_KBD
-        stx     unittab+STDIN_FILENO
         ldy     #$FF
         jsr     SETLFS
         jmp     OPEN            ; Will always succeed
 
         ldy     #0
         lda     tmp1
-        sta     (ptr2),y
-        inc     ptr2
+        sta     (ptr1),y
+        inc     ptr1
         bne     @L1
-        inc     ptr2+1          ; *buf++ = A;
+        inc     ptr1+1          ; *buf++ = A;
 
 ; Increment the byte count
 
 
 ; Decrement the count
 
-@L3:    inc     ptr1
+@L3:    inc     ptr2
         bne     @L0
-        inc     ptr1+1
+        inc     ptr2+1
         bne     @L0
         beq     done            ; Branch always
 
@@ -155,5 +151,3 @@ invalidfd:
 .bss
 
 unit:   .res    1
-
-