LSXDODGERS LDCALL

From Z80 Machines Wiki
Jump to: navigation, search

LDCALL

· LSX-Dodgers MSX-DOS CP / M 80 · System call list

System calls Place the function number in the C register It is executed by calling the address $0005. Function  number

$00 Program end Setting: None Return value: - Remarks: Terminate the running program and restart the system Same as program end by jump to address 0

$01 Console input Setting: None Return value: A ← 1 character input from the console Remarks: Wait for input without input. Display input characters on the console If there is input of [CTRL] + [C], [CTRL] + [S], processing is performed

$02 Console output Setting: E ← Character code to be output to the console Returns: None Remarks: If there is an input of [CTRL] + [C], [CTRL] + [S], perform processing

$03 External input Setting: None Return value: A ← 1 character read from AUX device

$04 External output Setting: E ← One character to output to AUX device Returns: None

$05 Printer output Setting: E ← 1 character to be output to the printer Returns: None

$06 Console direct I/O Setting: E ← $FF Console input E ← $FF Console output with its value as a character code Return value: In case of input A ← One character input (A ← 0 when there is no input) In case of output None Remarks: Do not process [CTRL] + [C], [CTRL] + [S] or echo back

$07 Console direct input *1 Setting: None Return value: A ← 1 character input from the console Remarks: Wait for input without input. Do not echo back to the console Processing of [CTRL] + [C], [CTRL] + [S] is not performed In the case of CP/M80, reading the I/O byte Return value: A ← I/O byte

$08 Echo None Console input *1 Setting: None Return value: A ← 1 character input from the console Remarks: Wait for input without input. Do not echo back to the console If there is input of [CTRL] + [C], [CTRL] + [S], processing is performed In the case of CP / M 80, setting the I/O byte Setting: E ← I/O byte

$09 String output Setting: DE ← Start address of character string outputted to the console prepared in memory response Returns: None Remarks: Append $ at the end of the string. Do not show $

$0A Character string input Setting: DE ← Address of the memory in which the maximum number of input characters (1 to $ FF) is set Return value: Address set to DE + 1 ← Actual input character string Remarks: If the number of input characters is less than the specified maximum, $0D is regarded as the end of input Eggplant Editable by screen edit when entering If [CTRL] + [C] is input, processing is performed $0B Console status check Setting: None Return value: When the key is pressed, A ← $FF When not pressed, A ← 0 $0C Acquire version number Setting: None Return value: HL ← $0022 Remarks: For CP/M

$0D Disk Reset Setting: None Returns: None Remarks: If there is data that has been changed but has not been written to disk yet Include the current drive as drive A and $0D80 for DTA . If there is a change in the size of the file, clone the file Also necessary

$0E Setting of current drive Setting: E ← Current drive number (A: 0, B: 1, ... H: 7) Returns: None

$0F Open file Setting: DE ← Start address of FCB of unopened file Return value: On success A ← 0 (to 3) Specified FCB ← setting of each field In case of failure A ← $FF $10 Close the file Setting: DE ← Start address of FCB of opened file Return value: On success A ← 0 In case of failure A ← $FF

$11 Search for the first file Setting: DE ← Start address of FCB of unopened file Return value: When found A ← 0 Area indicated by DTA ← of the file Drive number and directory entry Set the drive number to FCB In case of failure A ← $FF

$12 Search for the next file Setting: None Return value: When found A ← 0 Area indicated by DTA ← Drive number of the file Issue and directory entry In case of failure A ← $FF

$13 Delete file Setting: DE ← Start address of FCB of file to be deleted Return value: On success A ← 0 In case of failure A ← $FF Remarks: Wild card can be specified

$14 Sequential read Setting: DE ← Start address of FCB of opened file Current block of FCB ← Read start block Current FCB record ← Read start record Return value: On success A ← 0 Area indicated by DTA ← 1 record read For EOF A ← 1 In case of failure A ← $FF Remarks: The size of one record is 128 bytes

$15 Sequential writing Setting: DE ← Start address of FCB of opened file Current block of FCB ← Write start block Current FCB record ← Begin writing record DTA after memory area ← data to be written Return value: On success A ← 0 In case of failure A ← 1 Remarks: The size of one record is 128 bytes

$16 Creating a file Setting: DE ← Start address of FCB of unopened file Return value: On success A ← 0 (to 3) In case of failure A ← $FF

$17 Change file name Setting: DE ← Start address of the FCB of the file whose file name you want to change Start address of FCB + $11 ← New file name Return value: On success A ← 0 In case of failure A ← $FF Remarks: Wild card can not be specified (wild card can be specified for MSX-DOS)

$18 Obtaining login vector Setting: None Return value: HL ← Online drive information Remarks: Of the return values, each bit of the L register corresponds to the drive number, 1 Online, 0 if offline For LSX-Dodgers HL ← $00FF (simple process)

$19 Acquire the current drive number Setting: None Return value: A ← current drive number (A: 0, B: 1, ... H: 7)

$1A DTA setting Setting: DE ← Destination address (DTA address) Returns: None

$1B Acquisition of disc information *1 Setting: E ← Drive number containing the target disk (Current drive: 0, A: 1, B: 2, ... H: 8) Return value: A ← 1 Number of logical sectors per cluster BC ← Logical sector size DE ← Total number of clusters HL ← Total number of unused clusters IX ← Start address of DPB IY ← start address of FAT on memory In case of failure A ← $ FF Remarks: In the case of CP / M 80, reading file allocation information Return value: HL ← What area of the current disk is allocated to the file Start address of the memory area indicating

$1C Write-protected disk *2 Remarks: Since issue of this system call, until the system is booted again, Prohibit writing to

Survey of disks for which

$1D write is prohibited Setting: None Return value: HL ← Write protected drive information Remarks: Of the return values, each bit of the L register corresponds to the drive number, 1 Write prohibited, writeable if 0 For LSX-Dodgers HL ← $ 0000 (simple process)

$1E File attribute setting * 2 Setting: First character of extension of FCB and most significant bit of second character ← Attribute information Remarks: The most significant bit of the first character of the extension is 0 → Readable / writable 〃 1 → Read only The most significant bit of the second character of the extension is 0 → normal file 1 → System file $ 1 F Read the parameters of the disk device Setting: None Return value: HL ← Start address of DPB (drive A :) Remarks: The DPB structure of LSX-Dodgers differs from CP / M80 and MSX-DOS

$20 Setting and reading of user number Setting: E ← $ FF Read user number E ← $ FF Set the lower 5 bits of the value as the user number Return value: In case of input A ← Current user number In case of output None Remarks: In the LSX-Dodgers setting of the user number is ignored and the reading process is A ← 0

$21 Random read Setting: DE ← Start address of FCB of opened file FCB random record ← read start record Return value: On success A ← 0 Area indicated by DTA ← 1 record read In case of failure A ← 1 Remarks: The size of one record is 128 bytes

$22 Random Write Setting: DE ← Start address of FCB of opened file FCB random record ← write start record Memory area after DTA ← Data to be written Return value: On success A ← 0 In case of failure A ← 1 Remarks: The size of one record is 128 bytes

$23 Acquisition of file size Setting: DE ← Start address of FCB of unopened file Return value: On success A ← 0 FCB random record field ← size of specified file In case of failure A ← $ FF Remarks: Calculate the file size in units of 128 bytes. If it is 127 bytes If it is 1 by 300 bytes, it becomes 3

$24 Setting of random record field Setting: DE ← Start address of FCB of opened file Current block of FCB ← target block FCB current record ← target record Return value: Random record field of FCB ← The power of the specified file Rent block field and current record field Record position calculated from

26 Random block light *1 Setting: DE ← Start address of FCB of opened file FCB random record ← write start record Record size of FCB ← 1 (It can be freely set in MSX - DOS) HL ← Number of records to write Memory area after DTA ← Data to be written Return value: On success A ← 0 In case of failure A ← 1 Remarks: The size of one record is 1 byte (can be freely set in MSX - DOS)

$ 27 Random block read *1 Setting: DE ← Start address of FCB of opened file FCB random record ← read start record Record size of FCB ← 1 (It can be freely set in MSX - DOS) HL ← number of records to read Return value: On success A ← 0 HL ← Number of records actually read DTA area ← The data read If the specified number of records can not be read A ← 1 HL ← Number of records actually read DTA area ← The data read In case of failure A ← $ FF Remarks: The size of one record is 1 byte (can be freely set in MSX - DOS)

$28 Random write · Part 2 *2 Setting: DE ← Start address of FCB of opened file FCB random record ← write start record Memory area after DTA ← Data to be written Return value: On success A ← 0 In case of failure A ← 1 Remarks: The size of one record is 128 bytes

$29 Analysis of file name *3 Setting: DE ← Starting address containing filename to analyze HL ← start address of the FCB that stores the file that was analyzed

$2A Acquisition of date *1 Setting: None Return value: HL ← D ← Month E ← Day A ← Day of Week (0: days - 6: Saturday)

$2B Date setting *1 *2 Setting: HL ← D ← Month E ← Days Return value: On success A ← 0 In case of failure A ← $ FF

$2C Acquisition of Time *1 Setting: None Return value: H ← hour L ← minute D ← second E ← 1/100 second Remarks: According to the specification of X1 E ← 0

$2D Time setting *1 *2 Setting: H ← hour L ← minute D ← second E = 1/100 second Return value: On success A ← 0 In case of failure A ← $ FF

$2E Verify flag setting *1 *2 Setting: E ← 0 Set the verify flag E ← $ FF Reset the verify flag Returns: None

$2F Read using logical sectors *1 Setting: DE ← Logical sector number to start reading H ← Number of logical sectors to read L ← number of the disk drive to read (A: 0, B: 1, ... H: 7) Return value: On success A ← 0 DTA area ← The data read In case of failure A ← $ FF

$30 Write using logical sectors *1 Setting: DE ← Logical sector number to start writing H ← number of logical sectors to be written L ← Number of the disk drive to be written (A: 0, B: 1, ... H: 7) DTA area ← Data to be written Return value: On success A ← 0 In case of failure A ← $ FF

  • 1 Incompatible with CP/M80
  • 2 Unsupported by standard LSX-Dodgers
  • 3 LSX-Dodgers original function

※System call Remarks [CTRL] + [C] is the same as [SHIFT] + [BREAK] [CTRL] + [S] is the same as [BREAK] For LSX-Dodgers, save the registers used as return values, except for the A register and flags. Some CP/M 80 and MSX-DOS have specifications that destroy all registers. In order to make it work with CP/M80 or MSX-DOS, the necessary registers are Make it to save.