Apple2: mutualize mli filename push (-0 to -18 bytes)
This commit is contained in:
committed by
Oliver Schmidt
parent
3b8531a422
commit
280f296952
@@ -7,7 +7,7 @@
|
||||
.export _exec
|
||||
.import mli_file_info_direct
|
||||
.import aux80col
|
||||
.import pushname, popname, popax, done, _exit
|
||||
.import pushname_tos, popname, popax, done, _exit
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "errno.inc"
|
||||
@@ -28,8 +28,7 @@ _exec:
|
||||
stx ptr4+1
|
||||
|
||||
; Get and push name
|
||||
jsr popax
|
||||
jsr pushname
|
||||
jsr pushname_tos
|
||||
bne oserr
|
||||
|
||||
jsr mli_file_info_direct
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
;
|
||||
|
||||
.export _file_set_type, _file_set_auxtype
|
||||
.import pushname, popname, mli_file_info_direct
|
||||
.import pushname_tos, popname, mli_file_info_direct
|
||||
.import popa, popax
|
||||
.include "zeropage.inc"
|
||||
.include "errno.inc"
|
||||
.include "mli.inc"
|
||||
|
||||
new_value = ptr2 ; ptr1 is used by pushname
|
||||
new_value = ptr2 ; ptr1 is used by pushname_tos
|
||||
mod_flag = tmp1
|
||||
|
||||
UPDATE_TYPE = $00
|
||||
@@ -31,8 +31,7 @@ mli_update:
|
||||
sty mod_flag
|
||||
|
||||
; Get pathname
|
||||
jsr popax
|
||||
jsr pushname
|
||||
jsr pushname_tos
|
||||
bne oserr
|
||||
|
||||
; ProDOS 8 TechRef, 4.4.4: You should use
|
||||
|
||||
@@ -4,13 +4,15 @@
|
||||
; File name handling for ProDOS 8 file I/O
|
||||
;
|
||||
|
||||
.export pushname, popname
|
||||
.import subysp, addysp, decsp1
|
||||
.export pushname_tos, pushname, popname
|
||||
.import popax, subysp, addysp, decsp1
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "apple2.inc"
|
||||
.include "mli.inc"
|
||||
|
||||
pushname_tos:
|
||||
jsr popax
|
||||
pushname:
|
||||
sta ptr1
|
||||
stx ptr1+1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
;
|
||||
|
||||
.export mli_file_info
|
||||
.import pushname, popname, mli_file_info_direct
|
||||
.import pushname_tos, popname, mli_file_info_direct
|
||||
.import popax
|
||||
.include "zeropage.inc"
|
||||
.include "errno.inc"
|
||||
@@ -13,9 +13,8 @@
|
||||
; stored as C string in AX at top of stack
|
||||
; Returns with carry set on error, and sets errno
|
||||
mli_file_info:
|
||||
; Get pathname
|
||||
jsr popax
|
||||
jsr pushname
|
||||
; Get pathname from top of stack
|
||||
jsr pushname_tos
|
||||
bne oserr
|
||||
|
||||
jsr mli_file_info_direct
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
; filename stored on top of stack
|
||||
; Returns with carry set on error, and sets errno
|
||||
mli_file_info_direct:
|
||||
; Set pushed name
|
||||
; Set pushed name from TOS
|
||||
lda c_sp
|
||||
ldx c_sp+1
|
||||
sta mliparam + MLI::INFO::PATHNAME
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
.constructor raisefilelevel
|
||||
.destructor closeallfiles, 5
|
||||
|
||||
.import pushname, popname, __dos_type
|
||||
.import pushname_tos, popname, __dos_type
|
||||
.import iobuf_alloc, iobuf_free
|
||||
.import addysp, incsp4, incaxy, pushax, popax
|
||||
|
||||
@@ -87,8 +87,7 @@ found: sty tmp2
|
||||
sta tmp3
|
||||
|
||||
; Get and push name
|
||||
jsr popax
|
||||
jsr pushname
|
||||
jsr pushname_tos
|
||||
bne oserr1
|
||||
|
||||
; Set pushed name
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
;
|
||||
|
||||
.export __sysmkdir
|
||||
.import pushname, popname
|
||||
.import pushname_tos, popname
|
||||
.import addysp, popax
|
||||
|
||||
.include "zeropage.inc"
|
||||
@@ -18,8 +18,7 @@ __sysmkdir:
|
||||
jsr addysp
|
||||
|
||||
; Get and push name
|
||||
jsr popax
|
||||
jsr pushname
|
||||
jsr pushname_tos
|
||||
bne oserr
|
||||
|
||||
; Set pushed name
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
;
|
||||
|
||||
.export __sysrename
|
||||
.import pushname, popname
|
||||
.import pushname, pushname_tos, popname
|
||||
.import popax
|
||||
|
||||
.include "zeropage.inc"
|
||||
@@ -17,8 +17,7 @@ __sysrename:
|
||||
stx ptr2+1
|
||||
|
||||
; Get and push oldname
|
||||
jsr popax
|
||||
jsr pushname
|
||||
jsr pushname_tos
|
||||
bne oserr1
|
||||
|
||||
; Save pushed oldname
|
||||
|
||||
Reference in New Issue
Block a user