initcwd from Oliver Schmidt
git-svn-id: svn://svn.cc65.org/cc65/trunk@3466 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
37
libsrc/apple2/initcwd.s
Normal file
37
libsrc/apple2/initcwd.s
Normal file
@@ -0,0 +1,37 @@
|
||||
;
|
||||
; Oliver Schmidt, 18.04.2005
|
||||
;
|
||||
|
||||
.export initcwd
|
||||
.import __cwd
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "mli.inc"
|
||||
|
||||
initcwd:
|
||||
; Use imported buffer
|
||||
lda #<__cwd
|
||||
ldx #>__cwd
|
||||
sta mliparam + MLI::PREFIX::PATHNAME
|
||||
stx mliparam + MLI::PREFIX::PATHNAME+1
|
||||
|
||||
; Get current working directory
|
||||
lda #GET_PREFIX_CALL
|
||||
ldx #PREFIX_COUNT
|
||||
jsr callmli
|
||||
|
||||
; Check length byte
|
||||
ldx __cwd
|
||||
beq done
|
||||
|
||||
; Replace trailing slash with zero
|
||||
sta __cwd,x ; A = 0
|
||||
|
||||
; Remove length byte
|
||||
tax
|
||||
: inx
|
||||
lda __cwd,x
|
||||
sta __cwd-1,x
|
||||
bne :-
|
||||
|
||||
done: rts
|
||||
Reference in New Issue
Block a user