User Tools

Site Tools


x68000:doscall

This is an old revision of the document!


DOS CALL MANUAL

DOS Call list

CodeNameDescription
$ff00_EXITProgram end
$ff01_GETCHARGet keyboard input (with echo)
$ff02_PUTCHARPut character
$ff03_COMINPRS-232C 1 byte input
$ff04_COMOUTRS-232C 1 byte output
$ff05_PRNOUTPrinter 1 character output
$ff06_INPOUTCharacter I/O
$ff07_INKEYGet one character from the keyboard (no break check)
$ff08_GETCGet one character from the keyboard (with break check)
$ff09_PRINTPrint string
$ff0a_GETSGet character string (with break check)
$ff0b_KEYSNSKey input state check
$ff0c_KFLUSHKeyboard input after buffer flush
$ff0d_FFLUSHDisk reset
$ff0e_CHGDRVCurrent drive setting
$ff0f_DRVCTRLDrive status check/setting
CodeNameDescription
$ff10_CONSNSScreen output check
$ff11_PRNSNSPrinter output check
$ff12_CINSNSRS-232C input check
$ff13_COUTSNSRS-232C output check
$ff17_FATCHKFile concatenation state check
$ff18_HENDSPKanji conversion control
$ff19_CURDRVGet current drive
$ff1a_GETSSGet character string (no break check)
$ff1b_FGETCGet character from file
$ff1c_FGETSGet string from file
$ff1d_FPUTCWrite one character to file
$ff1e_FPUTSWrite string to file
$ff1f_ALLCLOSEClose all files
CodeNameDescription
$ff20_SUPERSupervisor/user mode setting
$ff21_FNCKEYGet/set redefinable key
$ff22_KNJCTRLKana-to-kanji conversion
$ff23_CONCTRLConsole control/direct output
$ff24_KEYCTRLConsole state check/direct input
$ff25_INTVCSSet vector processing address
$ff26_PSPSETCreate process management pointer
$ff27_GETTIM2Get time (longword)
$ff28_SETTIM2Set time (longword)
$ff29_NAMESTSFilename expansion
$ff2a_GETDATEGet date
$ff2b_SETDATESet date
$ff2c_GETTIMEGet time
$ff2d_SETTIMESet time
$ff2e_VERIFYSet verify flag
$ff2f_DUP0Force file handle copy
CodeNameDescription
$ff30_VERNUMGet OS version
$ff31_KEEPPRTerminate and stay resident
$ff32_GETDPBGet drive parameter block
$ff33_BREAKCKSet break check
$ff34_DRVXCHGReplace drive
$ff35_INTVCGGet vector processing address
$ff36_DSKFREGet disk space remaining
$ff37_NAMECKFilename expansion
$ff39_MKDIRCreate subdirectory
$ff3a_RMDIRRemove subdirectory
$ff3b_CHDIRChange current directory
$ff3c_CREATECreate file
$ff3d_OPENOpen file
$ff3e_CLOSEClose file
$ff3f_READRead file
CodeNameDescription
$ff40_WRITEWrite file
$ff41_DELETEDelete file
$ff42_SEEKSeek file
$ff43_CHMODSet/get file modes
$ff44_IOCTRLDevice driver ioctrl direct I/O
$ff45_DUPCopy file handle
$ff46_DUP2Force copy file handle
$ff47_CURDIRGet current directory
$ff48_MALLOCAllocate memory
$ff49_MFREEFree memory
$ff4a_SETBLOCKChange memory block
$ff4b_EXECLoad/execute program
$ff4c_EXIT2Exit with return code
$ff4d_WAITGet process end return code
$ff4e_FILESSearch files
$ff4f_NFILESSearch next files
CodeNameDescription
$ff80_SETPDBChange process information
$ff81_GETPDBGet process information
$ff82_SETENVSet environment variable
$ff83_GETENVGet environment variable
$ff84_VERIFYGGet verify flag
$ff85_COMMONCOMMON area control
$ff86_RENAMERename/move file
$ff87_FILEDATEGet/set file date
$ff88_MALLOC2Alloc memory
$ff8a_MAKETMPCreate temporary file
$ff8b_NEWFILECreate new file
$ff8c_LOCKLock file
$ff8f_ASSIGNGet/set/cancel virtual drive/directory assignment
CodeNameDescription
$ffaa FFLUSHSet FFLUSH mode (undocumented)
$ffab_OS_PATCHHook OS internal function (undocumented)
$ffac_GETFCBGet FCB pointer (undocumented)
$ffad_S_MALLOCAlloc memory using main memory management
$ffae_S_MFREEFree memory using main memory management
$ffaf_S_PROCESSSub memory management setting
CodeNameDescription
$fff0_EXITVC(program end execution address)
$fff1_CTRLVC(CTRL+C execution address at abort)
$fff2_ERRJVC(Error abort execution address)
$fff3_DISKREDBlock device direct input
$fff4_DISKWRTBlock device direct output
$fff5_INDOSFLGGet OS work pointer
$fff6_SUPER_JSRSupervisor subroutine call
$fff7_BUS_ERRCheck for bus error
$fff8_OPEN_PRRegister background task
$fff9_KILL_PRRemove background task
$fffa_GET_PRGet thread management information
$fffb_SUSPEND_PRForce thread to sleep
$fffc_SLEEP_PRSleep thread
$fffd_SEND_PRTransmit thread command/data
$fffe_TIME_PRGet timer counter value
$ffff_CHANGE_PRExecution right abandonment(?) 実行権放棄

Caution: Calls to $ff00~$ff7f in Human68k Version 2 have been moved to $ff80~$ffaf in Version 3 and later

Processing address calls at $fff5~$fff7 and $fffa~$fffe can not be changed(ignored) $fff8,$ffff is executed after the original processing is normally completed. $fff8 is called every time a thread is deleted.

Error code list

Hex codeByte codeDescription
$ffffffff -1Invalid function code executed
$fffffffe -2File not found
$fffffffd -3Directory not found
$fffffffc -4Too many open files
$fffffffb -5Directory and volume label inaccessible
$fffffffa -6The specified handle is not open
$fffffff9 -7The memory management area was destroyed
$fffffff8 -8
$fffffff7 -9Invalid memory management pointer specified
$fffffff6-10Illegal environment specified
$fffffff5-11Abnormal executable file format
$fffffff4-12Abnormal open access mode
$fffffff3-13Invalid file name
$fffffff2-14Called with invalid parameter
$fffffff1-15Invalid drive specified
$fffffff0-16Current directory can't be deleted
$ffffffef-17ioctrl can not be used
$ffffffee-18No more files found
$ffffffed-19The file can't be written
$ffffffec-20The directory already exists
$ffffffeb-21File can't be deleted
$ffffffea-22File can't be renamed
$ffffffe9-23File can't be created because disk is full
$ffffffe8-24File can't be created because folder is full
$ffffffe7-25Can't seek to the specified position
$ffffffe6-26Supervisor mode require while in supervisor mode
$ffffffe5-27Thread name exists
$ffffffe4-28IPC buffer is write protected
$ffffffe3-29Can't start any more background processes
$ffffffe0-32Insufficient lock space
$ffffffdf-33File is locked and can't be accessed
$ffffffde-34The drive has a handler open
$ffffffdd-35Symbolic link nest exceeded 16 links(lndrv)
$ffffffb0-80File exists

Detailed Descriptions

$ff00<BOOKMARK:EXIT>_EXITTerminate program
End the program. Open file handles are closed.
$ff01<BOOKMARK:GETCHAR>_GETCHARWait for keyboard input(with echo)
Argnone
Returnkey code
Wait for key input and output the character to stdout.
^C - Return to the parent process
^P - Toggle output stdout to the printer also
^N - Check the printer output state
$ff02<BOOKMARK:PUTCHAR>_PUTCHARDisplay character
ArgCODE.wSingle-byte character
ReturnAlways 0
Outputs the character specified by CODE to stdout.
It checks whether the key is ^C, ^S, ^P, or ^N.

Usage:

move	CODE,-(sp)
DOS	_PUTCHAR
addq.l	#2,sp
$FF3C<BOOKMARK:create>_CREATECreate file
Arg 1FILE.lPointer to file name
Arg 2ATR.wfile attribute (%XLAD_VSHR)
ReturnThe file handle of the created file. If negative, an error occured.
Create the specified file specified by FILE with the attributes specified in ATR.
If ATR is 0, it is interpreted as the Archive attribute.
If the file already exists the contents of that file will be lost. Directories, volume labels, and files with the System attribute are read-only and will not be deleted. When the MSB of ATR is set, even if the file already exists, it will not be deleted.

Usage:

move	ATR,-(sp)
pea	(FILE)
DOS	_CREATE
addq.l	#6,sp
$FF3D<BOOKMARK:open>_OPENOpen file
Arg 1FILE.lPointer to file name
Arg 2MODE.wAccess mode
ReturnThe file handle of the opened file. If negative, an error occured.
Open the file specified by FILE in the access mode specified by MODE.
If the file has the read-only attribute it will not open with write or read/write mode.

Valid values for mode:
bit 8 - Dictionary access mode
* %1 - A special file handle is used for dictionary. (Use is prohibited)
* %0 - normal

bit 6~4 - Sharing mode
* %100 always set
* %011 - Write only allowed
* %010 Read only allowed
* %001 Prohibited
* %000 Compatibility mode

bit 1 to 0 - Read/write mode
* %10 Read/write mode
* %01 Write mode
* %00 read mode

The sharing mode specified by bits 6~4 regulates sharing files between multiple processes. When multiple processes are running, each process can read and write the same file at the same time. This is potentially risky behavior and you should always specify an appropriate sharing mode to maintain exclusive control of file access.

Usage:

move	MODE,-(sp)
pea	(FILE)
DOS	_OPEN
addq.l	#6,sp
$FF3E<BOOKMARK:close>_CLOSEClose file
ArgFILENO.wFile handle
ReturnError code
Close the file handle specified by FILENO.

Usage:

move	FILENO,-(sp)
DOS	_CLOSE
addq.l	#2,sp
x68000/doscall.1504988122.txt.gz · Last modified: 2019/08/27 20:44 (external edit)