From: cuz Date: Sun, 24 Jul 2005 13:20:49 +0000 (+0000) Subject: Added initcwd.s from Stefan Haubenthal which initializes _cwd on startup. X-Git-Tag: V2.12.0~303 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8334d5462295d6da175e498c75dea75c92c3c6de;p=cc65 Added initcwd.s from Stefan Haubenthal which initializes _cwd on startup. git-svn-id: svn://svn.cc65.org/cc65/trunk@3540 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/cbm/Makefile b/libsrc/cbm/Makefile index 29dbc49f2..555109735 100644 --- a/libsrc/cbm/Makefile +++ b/libsrc/cbm/Makefile @@ -70,6 +70,7 @@ S_OBJS = c_acptr.o \ gotox.o \ gotoxy.o \ gotoy.o \ + initcwd.o \ open.o \ oserrlist.o \ oserror.o \ diff --git a/libsrc/cbm/initcwd.s b/libsrc/cbm/initcwd.s new file mode 100644 index 000000000..2df6dba85 --- /dev/null +++ b/libsrc/cbm/initcwd.s @@ -0,0 +1,35 @@ +; +; Stefan Haubenthal, 2005-06-08 +; +; CBM _curunit to _cwd +; + + .export initcwd + .import __curunit, __cwd + .import pusha0, tosudiva0 + .importzp sreg, ptr1 + + .macpack generic + + .segment "INIT" + +.proc initcwd + + lda __curunit + jsr pusha0 + lda #10 + jsr tosudiva0 + ldx #0 + lda sreg + beq :+ ; >=10 + add #'0' + sta __cwd + inx +: lda ptr1 ; rem + add #'0' + sta __cwd,x + lda #0 + sta __cwd+1,x + rts + +.endproc