mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 00:29:31 +00:00
76a5a72403
Moving __cwd from BSS into INITBSS does of course ;-) not only impact the CBM targets but all targets with disk I/O support. Note: Code using `__cwd-1` may trigger an ld65 range error because __cwd may end up at the very begining of a segment. As far as I see this is an ld65 bug which I'm not try to fix - at least here.
34 lines
658 B
ArmAsm
34 lines
658 B
ArmAsm
;
|
|
; Stefan Haubenthal, 2008-04-29
|
|
;
|
|
|
|
.export initcwd
|
|
.import findfreeiocb
|
|
.import __cwd
|
|
.include "atari.inc"
|
|
|
|
.proc initcwd
|
|
|
|
lda #0
|
|
sta __cwd
|
|
jsr findfreeiocb
|
|
bne oserr
|
|
lda #GETCWD
|
|
sta ICCOM,x
|
|
lda #<__cwd
|
|
sta ICBLL,x
|
|
lda #>__cwd
|
|
sta ICBLH,x
|
|
jsr CIOV
|
|
bmi oserr
|
|
ldx #$FF ; ATEOL -> \0
|
|
: inx
|
|
lda __cwd,x
|
|
cmp #ATEOL
|
|
bne :-
|
|
lda #0
|
|
sta __cwd,x
|
|
oserr: rts
|
|
|
|
.endproc
|