1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 02:29:52 +00:00
cc65/libsrc/cbm/sysrename.s
uz 89951068dd writefndiskcmd gets its arguments in ptr1 and Y.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3945 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-22 15:40:06 +00:00

53 lines
1.1 KiB
ArmAsm

;
; Ullrich von Bassewitz, 2009-02-22
;
; unsigned char __fastcall__ _sysrename (const char *oldpath, const char *newpath);
;
.export __sysrename
.import fnparse, fnadd, fnparsename
.import opencmdchannel, closecmdchannel, writefndiskcmd
.import popax
.import fncmd, fnunit
.importzp ptr1
;--------------------------------------------------------------------------
; __sysrename:
.proc __sysrename
jsr fnparse ; Parse first filename, pops newpath
bne done
lda #'='
jsr fnadd
jsr popax
sta ptr1
stx ptr1+1
ldy #0
jsr fnparsename ; Parse second filename
bne done
ldx fnunit
jsr opencmdchannel
bne done
lda #'r' ; Rename command
sta fncmd
jsr writefndiskcmd
pha
ldx fnunit
jsr closecmdchannel
pla
done: rts
.endproc