1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-04 13:29:35 +00:00
cc65/libsrc/apple2/initcwd.s
cuz ccd4955384 initcwd from Oliver Schmidt
git-svn-id: svn://svn.cc65.org/cc65/trunk@3466 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-04-19 11:31:00 +00:00

38 lines
725 B
ArmAsm

;
; 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