mirror of
https://github.com/cc65/cc65.git
synced 2024-12-26 08:32:00 +00:00
710f59b654
git-svn-id: svn://svn.cc65.org/cc65/trunk@4680 b7a2c559-68d2-44c3-8de9-860c34a00d81
55 lines
1.0 KiB
ArmAsm
55 lines
1.0 KiB
ArmAsm
;
|
|
; Oliver Schmidt, 2010-05-24
|
|
;
|
|
; int __fastcall__ rootdir (unsigned char drive, char* buf);
|
|
;
|
|
|
|
.export _rootdir
|
|
.import popax, oserrexit
|
|
|
|
.include "zeropage.inc"
|
|
.include "errno.inc"
|
|
.include "mli.inc"
|
|
|
|
_rootdir:
|
|
; Save buf
|
|
sta ptr1
|
|
stx ptr1+1
|
|
|
|
; Set buf
|
|
sta mliparam + MLI::ON_LINE::DATA_BUFFER
|
|
stx mliparam + MLI::ON_LINE::DATA_BUFFER+1
|
|
|
|
; Set drive
|
|
jsr popax
|
|
sta mliparam + MLI::ON_LINE::UNIT_NUM
|
|
|
|
; Get volume name
|
|
lda #ON_LINE_CALL
|
|
ldx #ON_LINE_COUNT
|
|
jsr callmli
|
|
bcs oserr
|
|
|
|
; Get volume name length
|
|
ldy #$00
|
|
lda (ptr1),y
|
|
and #15 ; Max volume name length
|
|
sta tmp1
|
|
|
|
; Add leading slash
|
|
lda #'/'
|
|
sta (ptr1),y
|
|
|
|
; Add terminating zero
|
|
ldy tmp1
|
|
iny
|
|
lda #$00
|
|
sta (ptr1),y
|
|
|
|
; Return success
|
|
tax
|
|
rts
|
|
|
|
; Return oserror
|
|
oserr: jmp oserrexit
|