83Plus:Software:usb8x/Asm Interface/MSD/DOS createFile

From WikiTI
Revision as of 02:14, 17 August 2006 by Brandonw (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Name: DOS_createFile

Minimum usb8x version: 0.10

Creates a new file in specified directory of size 0.


  • BC points to the starting cluster of the directory to create file in (obtained with [[../FAT_getStartingCluster|FAT_getStartingCluster]])
  • HL points to an ASCIIZ string of the filename (ex. "test.txt")


  • File is created with size 0
  • C set if problems


  • AF, BC, DE, HL


The file created date/time attributes are set according to the 84+/SE clock. Example code to create "readme.txt" in "test" directory:

ld hl,sDirectory
U_CALL FAT_getStartingCluster
push hl
pop bc ;BC contains starting cluster
ld hl,sFilename
U_CALL DOS_createFile
sFilename: DB "readme.txt",0
sDirectory: DB "/test",0

See Also

  • [[../FAT_getStartingCluster|FAT_getStartingCluster]] - Get starting cluster of specified directory