Preserve INBUF
This commit is contained in:
parent
76178cf0a8
commit
92228cef9e
|
@ -7,4 +7,5 @@ BELL := $FBE4
|
|||
|
||||
ldy #0
|
||||
jsr BELL
|
||||
clc
|
||||
rts
|
||||
|
|
18
echo.cmd.s
18
echo.cmd.s
|
@ -9,13 +9,23 @@ INBUF := $200
|
|||
|
||||
jsr CROUT
|
||||
|
||||
ldx #cmd_length
|
||||
: lda INBUF,x
|
||||
inx
|
||||
ldx #cmd_length-1
|
||||
|
||||
;; Skip spaces
|
||||
: inx
|
||||
lda INBUF,x
|
||||
cmp #' ' | $80
|
||||
beq :-
|
||||
dex
|
||||
|
||||
;; Echo string
|
||||
: inx
|
||||
lda INBUF,x
|
||||
jsr COUT
|
||||
cmp #$8D
|
||||
cmp #$D | $80
|
||||
bne :-
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ COUT := $FDED
|
|||
jmp :-
|
||||
|
||||
done: jsr CROUT
|
||||
clc
|
||||
rts
|
||||
|
||||
str: .byte "Hello, world!", 0
|
16
path.s
16
path.s
|
@ -340,7 +340,6 @@ fail_gfi:
|
|||
sta RWREFNUM
|
||||
sta CFREFNUM
|
||||
|
||||
|
||||
lda #<cmd_load_addr
|
||||
sta RWDATA
|
||||
lda #>cmd_load_addr
|
||||
|
@ -354,15 +353,26 @@ fail_gfi:
|
|||
MLI_CALL READ, SREAD
|
||||
bne fail_load
|
||||
|
||||
;; CLOSE call trashes INBUF ????
|
||||
;; CLOSE call trashes lower bytes of INBUF, so stash it.
|
||||
ldx #$7F
|
||||
: lda INBUF,x
|
||||
sta INBUF+$80,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
MLI_CALL CLOSE, SCLOSE
|
||||
jsr FREEBUFR
|
||||
|
||||
;; Restore it.
|
||||
ldx #$7F
|
||||
: lda INBUF+$80,x
|
||||
sta INBUF,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
;; Invoke command
|
||||
jsr cmd_load_addr
|
||||
|
||||
clc ; Success
|
||||
rts ; Return to BASIC.SYSTEM
|
||||
|
||||
fail_load:
|
||||
|
|
Loading…
Reference in New Issue