mirror of
https://github.com/a2stuff/prodos-path.git
synced 2025-02-10 03:30:58 +00:00
PATH: Shave 9 bytes
This commit is contained in:
parent
af1c8f1865
commit
0c01446574
@ -36,6 +36,9 @@ Example:
|
||||
Notes:
|
||||
* `PATH` can be invoked as lower case (e.g. `path /hd/cmd`)
|
||||
* Commands can be invoked as lower case (e.g. `hello`)
|
||||
* A relative `PATH` (e.g. `path bin`) only works if an explicit prefix is set.
|
||||
* Note that if no prefix has been set, or if you run `prefix /`, BASIC.SYSTEM will use the last accessed slot and drive and the `PREFIX` command will report that volume as a prefix even though it is empty.
|
||||
|
||||
|
||||
Sample commands included:
|
||||
* `HELLO` - shows a short message, for testing purposes
|
||||
|
45
path.s
45
path.s
@ -330,7 +330,7 @@ notok: dey
|
||||
|
||||
;; Indicate end of command string for BI's parser (if command uses it)
|
||||
dex
|
||||
stx XLEN
|
||||
stx xlen ; assigned to `XLEN` later
|
||||
|
||||
;; Check to see if path exists.
|
||||
lda #$A ; param length
|
||||
@ -345,14 +345,11 @@ notok: dey
|
||||
bne compose ; wrong type - try next path directory
|
||||
|
||||
;; Tell BASIC.SYSTEM it was handled.
|
||||
lda #0
|
||||
sta XCNUM
|
||||
sta PBITS
|
||||
sta PBITS+1
|
||||
lda #<XRETURN
|
||||
sta XTRNADDR
|
||||
lda #>XRETURN
|
||||
sta XTRNADDR+1
|
||||
ldx #xtrnaddr_len - 1
|
||||
: lda xtrnaddr,x
|
||||
sta XTRNADDR,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
;; MLI/BI trashes part of INBUF (clock driver?), so stash it in upper half.
|
||||
ldx #$7F
|
||||
@ -374,14 +371,12 @@ notok: dey
|
||||
sta RWREFNUM
|
||||
sta CFREFNUM
|
||||
|
||||
lda #<cmd_load_addr
|
||||
sta RWDATA
|
||||
lda #>cmd_load_addr
|
||||
sta RWDATA+1
|
||||
lda #<max_cmd_size
|
||||
sta RWCOUNT
|
||||
lda #>max_cmd_size
|
||||
sta RWCOUNT+1
|
||||
;; Assign `RWDATA` and `RWCOUNT`
|
||||
ldx #rwdata_len - 1
|
||||
: lda rwdata,x
|
||||
sta RWDATA,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
lda #READ
|
||||
jsr GOSYSTEM
|
||||
@ -407,6 +402,22 @@ notok: dey
|
||||
fail_load:
|
||||
rts
|
||||
|
||||
|
||||
;;; Assigned to `XTRNADDR`, `XLEN`, `XCNUM`, and `PBITS`
|
||||
xtrnaddr:
|
||||
.addr XRETURN ; assigned to `XTRNADDR`
|
||||
xlen: .byte 0 ; assigned to `XLEN`
|
||||
.byte 0 ; assigned to `XCNUM`
|
||||
.word 0 ; assigned to `PBITS`
|
||||
xtrnaddr_len = * - xtrnaddr
|
||||
|
||||
|
||||
;;; Assigned to `RWDATA` and `RWCOUNT`
|
||||
rwdata:
|
||||
.addr cmd_load_addr ; assigned to `RWDATA`
|
||||
.word max_cmd_size ; assigned to `RWCOUNT`
|
||||
rwdata_len = * - rwdata
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
execute:
|
||||
|
Loading…
x
Reference in New Issue
Block a user