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

35
libsrc/cbm/devicestr.s Normal file
View File

@@ -0,0 +1,35 @@
;
; Stefan Haubenthal, 2005-06-08
;
; CBM device to string
;
.export devicestr
.import pusha0, tosudiva0
.importzp sreg, ptr1, ptr2
.macpack generic
;------------------------------------------------------------------------------
; Convert unit number in A into string representation pointed to by ptr2.
.proc devicestr
jsr pusha0
lda #10
jsr tosudiva0
ldy #0
lda sreg
beq :+ ; >=10
add #'0'
sta (ptr2),y
iny
: lda ptr1 ; rem
add #'0'
sta (ptr2),y
iny
lda #0
sta (ptr2),y
rts
.endproc