10 OPEN 2,8,2,"BOGUS.TXT,S,R" 20 IF ST<>0 THEN GOTO 50 30 GET #2,A$:PRINT A$; 40 GOTO 20 50 PRINT:PRINT "ERROR";ST 60 CLOSE 2Curiously, this program reads a $c7 before ST has $42 if the file does not exist.
The following assembly test program just emits an endless stream of CRs.
What am I doing wrong here?
.org $9000 READST =$ffb7 SETLFS =$ffba SETNAM =$ffbd OPEN =$ffc0 CHKIN =$ffc6 CHRIN =$ffcf CHROUT =$ffd2 CLALL =$ffe7 GETIN =$ffe4 jmp start error: .byte 0 status: .byte 0 start: lda #13 ldx #<name ldy #>name jsr SETNAM lda #2 ldx #8 ldy #2 jsr SETLFS jsr OPEN bcs onErr ldx #2 jsr CHKIN bcs onErr loop: jsr READST cmp #0 bne onErr jsr GETIN bcs onErr jsr CHROUT bra loop onErr: sta error jmp CLALL name: .str "bogus.txt,s,r"