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
|
|
|
|
2015-10-14 20:52:09 +00:00
|
|
|
lda #0
|
|
|
|
sta __cwd
|
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
|
2015-10-14 22:15:38 +00:00
|
|
|
ldx #$FF ; ATEOL -> \0
|
|
|
|
: inx
|
|
|
|
lda __cwd,x
|
2013-05-09 11:56:54 +00:00
|
|
|
cmp #ATEOL
|
|
|
|
bne :-
|
|
|
|
lda #0
|
2015-10-14 22:15:38 +00:00
|
|
|
sta __cwd,x
|
2013-05-09 11:56:54 +00:00
|
|
|
oserr: rts
|
2010-05-01 22:33:25 +00:00
|
|
|
|
|
|
|
.endproc
|