File Device
device-fileThe File device provides basic access to the file system (read, write, or delete files).
$00 - not accessible
$01 - file
$02 - directory
=== [2][RO] size
The size of the file being processed (zero for directories). Files larger than 64KB will still show up as 64KB in size.
=== [2][RO] success
The total bytes being read or written by the last operation.
=== [2][RW] length
The length of the read and write buffer in bytes.
=== [2][RW] read
The address of the area of memory where data read from the file will be read into (up to file.length bytes). If the file being accessed is a directory, its content will be listed on separate lines, in the following format:
<type> <size> <name>
e.g.
01 003B test1.txt
01 0234 test2.txt
02 0000 example
Where:
Type indicates either a file (01) or a directory (02).
Size is the size (up to 64KiB) of the file in bytes, in hexadecimal format.
Name is the name of the file.
=== [2][RW] write
The address of the area of memory containing the data to write to the file (up to file.length bytes).
=== [1][RW] operation
The operation to perform on the specified file. If an error occurs, it will be written to the system.error address, starting with 3 as high nibble.
$01 - read
$02 - write
$03 - append
$04 - delete
;file
.macro file.path $30
.macro file.type $32
.macro file.size $33
.macro file.success $35
.macro file.length $37
.macro file.read $39
.macro file.write $3B
.macro file.operation $3D
=== [2][RW] path
The address of the string corresponding to the name or path to the file or directory to access.
=== [1][RO] type
The type of the file being accessed. It can be set to one of the following values: