1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-11 01:05:25 +00:00
cc65/libsrc/apple2/sysmkdir.s
cuz c732d3e360 New stuff contributed by Oliver Schmidt
git-svn-id: svn://svn.cc65.org/cc65/trunk@3608 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-08-31 20:11:45 +00:00

56 lines
1.2 KiB
ArmAsm

;
; Oliver Schmidt, 15.04.2005
;
; unsigned char _sysmkdir (const char* name, ...);
;
.export __sysmkdir
.import pushname, popname
.import addysp, popax
.include "zeropage.inc"
.include "mli.inc"
__sysmkdir:
; Throw away all parameters except the name
dey
dey
jsr addysp
; Get and push name
jsr popax
jsr pushname
bne oserr
; Set pushed name
lda sp
ldx sp+1
sta mliparam + MLI::CREATE::PATHNAME
stx mliparam + MLI::CREATE::PATHNAME+1
; Set all other parameters from template
ldx #(MLI::CREATE::CREATE_TIME+1) - (MLI::CREATE::PATHNAME+1) - 1
: lda CREATE,x
sta mliparam + MLI::CREATE::ACCESS,x
dex
bpl :-
; Make directory
lda #CREATE_CALL
ldx #CREATE_COUNT
jsr callmli
; Cleanup name
jsr popname ; Preserves A
oserr: rts
.rodata
CREATE: .byte %11000011 ; ACCESS: Standard full access
.byte $0F ; FILE_TYPE: Directory file
.word $0000 ; AUX_TYPE: N/A
.byte $0D ; STORAGE_TYPE: Linked directory file
.word $0000 ; CREATE_DATE: Current date
.word $0000 ; CREATE_TIME: Current time