From 5d56dd1e2ad351da404590152215513e55e4eb2b Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Wed, 9 Jan 2019 17:33:33 -0800 Subject: [PATCH] fix leading spaces (again); squeeze bytes --- path.s | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/path.s b/path.s index c9fac6d..583aa84 100644 --- a/path.s +++ b/path.s @@ -141,19 +141,22 @@ CASE_MASK = $DF page_num9 := *+2 ; address needing updating jsr skip_leading_spaces + ldy #0 ; position in command string + page_num6 := *+2 ; address needing updating nxtchr: jsr to_upper_ascii page_num1 := *+2 ; address needing updating - cmp command_string,x + cmp command_string,y bne check_if_token inx - cpx #command_length + iny + cpy #command_length bne nxtchr ;; A match - indicate end of command string for BI's parser. - lda #command_length-1 - sta XLEN + dey + sty XLEN ;; Point BI's parser at the command execution routine. lda #XRETURN sta XTRNADDR+1 + ;; MLI/BI trashes part of INBUF, so stash it in upper half. + ldx #$7F +: lda INBUF,x + sta INBUF+$80,x + dex + bpl :- + ;; Reserve buffer for I/O lda #4 jsr GETBUFR @@ -341,21 +349,13 @@ fail_gfi: lda #>max_cmd_size sta RWCOUNT+1 - MLI_CALL READ, SREAD bne fail_load - ;; 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. + ;; Restore INBUF now that MLI/BI work is done. ldx #$7F : lda INBUF+$80,x sta INBUF,x