Introduced getdevicedir() - with implementation for the CBMs.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5840 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc
2012-10-07 19:18:56 +00:00
parent 3470f230ae
commit 987c3066a3
5 changed files with 143 additions and 20 deletions

View File

@@ -5,31 +5,18 @@
;
.export initcwd
.import __curunit, __cwd
.import pusha0, tosudiva0
.importzp sreg, ptr1
.macpack generic
.import __curunit, __cwd, devicestr
.importzp ptr2
.segment "INIT"
.proc initcwd
lda #<__cwd
ldx #>__cwd
sta ptr2
stx ptr2+1
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
jmp devicestr
.endproc