2010-05-01 22:33:25 +00:00
|
|
|
;
|
|
|
|
; Stefan Haubenthal, 2008-04-29
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export initcwd
|
|
|
|
.import findfreeiocb
|
|
|
|
.import __cwd
|
|
|
|
.include "atari.inc"
|
2010-05-01 22:33:25 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc initcwd
|
2010-05-01 22:33:25 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr findfreeiocb
|
|
|
|
bne oserr
|
2013-06-07 22:35:07 +00:00
|
|
|
lda #GETCWD
|
2013-05-09 11:56:54 +00:00
|
|
|
sta ICCOM,x
|
|
|
|
lda #<__cwd
|
|
|
|
sta ICBLL,x
|
|
|
|
lda #>__cwd
|
|
|
|
sta ICBLH,x
|
|
|
|
jsr CIOV
|
|
|
|
bmi oserr
|
|
|
|
ldx #0 ; ATEOL -> \0
|
|
|
|
: lda __cwd,x
|
|
|
|
inx
|
|
|
|
cmp #ATEOL
|
|
|
|
bne :-
|
|
|
|
lda #0
|
|
|
|
sta __cwd-1,x
|
|
|
|
oserr: rts
|
2010-05-01 22:33:25 +00:00
|
|
|
|
|
|
|
.endproc
|