📄 rxdos.asm
字号:
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Code Segment Data ;
;...............................................................;
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Days In Month Table ;
;...............................................................;
DaysInMonthTable: db 31 ; Jan
db 28 ; Feb
db 31 ; Mar
db 30 ; Apr
db 31 ; May
db 30 ; Jun
db 31 ; Jul
db 31 ; Aug
db 30 ; Sep
db 31 ; Oct
db 30 ; Nov
db 31 ; Dec
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Accumulated Days Per Month Table ;
;...............................................................;
AccumDaysPerMonthTable: dw 0 ; Jan
dw 31 ; Feb
dw 59 ; Mar
dw 90 ; Apr
dw 120 ; May
dw 151 ; Jun
dw 181 ; Jul
dw 212 ; Aug
dw 243 ; Sep
dw 273 ; Oct
dw 304 ; Nov
dw 334 ; Dec
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Bit Shift Table ;
;...............................................................;
_bitShiftTable: db 1 ; 0
db 2 ; 1
db 4 ; 2
db 8 ; 3
db 16 ; 4
db 32 ; 5
db 64 ; 6
db 128 ; 7
sizeShiftTable equ ($ - _bitShiftTable)
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Invalid Characters in Filename ;
;...............................................................;
_invalidFnCharacters: db '[]<>|",;=+:', 0
sizeInvFnChars equ ($ - _invalidFnCharacters)
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Extended Error Tables ;
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
; ;
; macro requires error code, locus, sug-action, class. ;
; ;
;...............................................................;
pexterrInvalidFunction EXTERRORCODE <errInvalidFunction, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrFileNotFound EXTERRORCODE <errFileNotFound, \
ERRLOC_DISK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrPathNotFound EXTERRORCODE <errPathNotFound, \
ERRLOC_DISK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrIllegalName EXTERRORCODE <errIllegalName, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrNoHandlesAvailable EXTERRORCODE <errNoHandlesAvailable, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_OUTRES >
pexterrAccessDenied EXTERRORCODE <errAccessDenied, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrInvalidHandle EXTERRORCODE <errInvalidHandle, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrArenaTrashed EXTERRORCODE <errArenaTrashed, \
ERRLOC_MEM, ERRACT_USER, ERRCLASS_NOTFND >
pexterrNotEnoughMemory EXTERRORCODE <errNotEnoughMemory, \
ERRLOC_MEM, ERRACT_RETRY, ERRCLASS_NOTFND >
pexterrInvalidBlock EXTERRORCODE <errInvalidBlock, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrInvalidAccess EXTERRORCODE <errInvalidAccess, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrInvalidDrive EXTERRORCODE <errInvalidDrive, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrCurrentDirectory EXTERRORCODE <errCurrentDirectory, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_AUTH >
pexterrNoMoreFiles EXTERRORCODE <errNoMoreFiles, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
pexterrFileExists EXTERRORCODE <errFileExists, \
ERRLOC_UNK, ERRACT_USER, ERRCLASS_NOTFND >
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Real Time Dos ;
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
; ;
; ;
; Items marked by (*) are Undocumented DOS Functions. ;
;...............................................................;
_RxDOS_functions:
dw _TerminateProcess_00 ; 00 - Program terminate
dw _KeyboardInput ; 01 - Keyboard input
dw _DisplayOutput ; 02 - Display output
dw _AuxInput ; 03 - Aux input
dw _AuxOutput ; 04 - Aux output
dw _PrinterOutput ; 05 - Printer output
dw _DirectConsole ; 06 - Direct console
dw _DirectConsoleInputNoEcho ; 07 - Direct console input noecho
dw _ConsoleInputNoEcho ; 08 - Console input noecho
dw _DisplayString ; 09 - Display string
dw _BufferedKeyboardInput ; 0A - Buffered keyboard input
dw _CheckKeyboardInput ; 0B - Check keyboard input
dw _ClearBufferedKeyboardInput ; 0C - Clear buffered keyboard input
dw _DiskReset ; 0D - Disk reset
dw _SelectDisk ; 0E - Select disk
dw _OpenFileFCB ; 0F - Open file FCB
dw _CloseFileFCB ; 10 - Close file FCB
dw _SearchFirstFileFCB ; 11 - Search first file FCB
dw _SearchNextFileFCB ; 12 - Search next file FCB
dw _DeleteFileFCB ; 13 - Delete file FCB
dw _SeqReadFileFCB ; 14 - Seq read file FCB
dw _SeqWriteFileFCB ; 15 - Seq write file FCB
dw _CreateFileFCB ; 16 - Create file FCB
dw _RenameFileFCB ; 17 - Rename file FCB
dw _UnusedReturnInst ; 18 - Unused
dw _CurrentDisk ; 19 - Current disk
dw _SetDiskTransferAddress ; 1A - Set disk transfer address
dw _GetDefaultDriveData ; 1B - Get default drive data
dw _GetDriveData ; 1C - Get drive data
dw _UnusedReturnInst ; 1D - Unused
dw _UnusedReturnInst ; 1E - Unused
dw _GetDefaultDriveParameterBlock ; 1F - Get default drive parameter block
dw _UnusedReturnInst ; 20 - Unused
dw _ReadFileFCB ; 21 - Read file FCB
dw _WriteFileFCB ; 22 - Write file FCB
dw _FileSizeFCB ; 23 - File size FCB
dw _SetRelativeRecordFCB ; 24 - Set relative record FCB
dw _SetInterruptVector ; 25 - Set interrupt vector
dw _CreateNewProgramSeg ; 26 - Create new program seg
dw _RandomBlockReadFCB ; 27 - Random block read FCB
dw _RandomBlockWriteFCB ; 28 - Random block write FCB
dw _ParseFilenameFCB ; 29 - Parse filename FCB
dw _GetDate ; 2A - Get date
dw _SetDate ; 2B - Set date
dw _GetTime ; 2C - Get time
dw _SetTime ; 2D - Set time
dw _SetVerifySwitch ; 2E - Set verify switch
dw _GetDiskTransferAddress ; 2F - Get disk transfer address
dw _GetDOSVersion ; 30 - Get DOS version
dw _TerminateStayResident ; 31 - Terminate stay resident
dw _GetDriveParameterBlock ; 32 - Get drive parameter block
dw _CtrlBreakCheck ; 33 - Ctrl break check
dw _GetInDOSFlagAddress ; 34 - Get INDOS flag address
dw _GetInterruptVector ; 35 - Get interrupt vector
dw _GetFreeDiskSpace ; 36 - Get free disk space
dw _GetSetSwitchChar ; 37 - Get/set switch char
dw _CountryDependentInfo ; 38 - Country dependent info
dw _CreateSubdirectory ; 39 - Create subdirectory
dw _RemoveSubdirectory ; 3A - Remove subdirectory
dw _ChangeSubdirectory ; 3B - Change subdirectory
dw _CreateFile ; 3C - Create file
dw _OpenFile ; 3D - Open file
dw _CloseFile ; 3E - Close file
dw _ReadFile ; 3F - Read file
dw _WriteFile ; 40 - Write file
dw _DeleteFile ; 41 - Delete file
dw _MoveFilePointer ; 42 - Move file pointer
dw _ChangeFileMode ; 43 - Change file mode
dw _IoControl ; 44 - Io Control
dw _DuplicateFileHandle ; 45 - Duplicate file handle
dw _ForceFileHandle ; 46 - Force file handle
dw _GetCurrentDirectory ; 47 - Get current directory
dw _AllocateMemory ; 48 - Allocate memory
dw _FreeAllocatedMemory ; 49 - Free allocated memory
dw _ModifyAllocatedMemory ; 4A - Modify allocated memory
dw _ExecuteProgram ; 4B - ExecuteProgram
dw _TerminateProcess ; 4C - Terminate process
dw _GetReturnCode ; 4D - Get return code
dw _FindFirstFile ; 4E - Find first file
dw _FindNextFile ; 4F - Find next file
dw _SetPSPAddress ; 50 - Set PSP Address
dw _GetPSPAddress ; 51 - Get PSP Address
dw _GetDosDataTablePtr ; 52*- (Get DOS Data Table)
dw _TranslateBIOSParameterBlock ; 53*- (Translate BIOS Parameter Block )
dw _GetVerify ; 54 - Get verify
dw _DuplicatePSP ; 55*- (Duplicate PSP block)
dw _RenameFile ; 56 - Rename file
dw _SetFileDateTime ; 57 - Set file date time
dw _GetAllocationStrategy ; 58 - Get allocation strategy
dw _GetExtendedError ; 59 - Get extended error
dw _CreateUniqueFile ; 5A - Create unique file
dw _CreateNewFile ; 5B - Create new file
dw _LockFileAccess ; 5C - Lock file access
dw _ServerShareAndSwap ; 5D*- (Server, Share And Swap)
dw _GetMachineName ; 5E - Get machine name
dw _GetRedirectionList ; 5F - Get redirection list
dw _GetActualFileName ; 60*- (Get Actual FileName )
dw _Unused ; 61 - Unused
dw _GetPSPAddress ; 62 - Get PSP Address
dw _GetDBCSString ; 63*- (Get DBCS String)
dw _Unused ; 64 - Unused
dw _ExtCountryDependentFunctions ; 65 - Extended Country Dependent Functions
dw _GlobalCodePage ; 66 - Get/Set Global Code Page
dw _SetHandlesCount ; 67 - Set Handles Count
dw _CommitFile ; 68 - Commit File
dw _GetDiskSerialNumber ; 69*- (Get disk serial number)
dw _CommitFile ; 6A*- (Commit File (same as 68))
dw _Unused ; 6B - Unused
dw _ExtendedOpenCreate ; 6C - Extended Open/ Create
dw _Unused ; 6D - DOS in ROM Functions
dw _Unused ; 6E - DOS in ROM Functions
dw _Unused ; 6F - DOS in ROM Functions
dw _Unused ; 70 - Unused or unknown
dw _Unused ; 71 - Chicago long filenames
dw _Unused ; 72 - Chicago long filenames
_RxDOS_functionsLast:
dw _Unused ; *- items: Undocumented DOS Functions
_RxDOS_maxFunctionCode = (_RxDOS_functionsLast - _RxDOS_functions)/2
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Critical Section Patch Area ;
;...............................................................;
_RxDOS_CritSectPatches dw 5 dup (0) ; added later
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Interrupt 21 ;
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
; ;
; ah contains function request ;
;...............................................................;
_Interrupt_21 proc far
push es
push ds
push bp
push di
push si
push dx
push cx
push bx
push ax
mov bp, sp
add bp, sizeStackFrame
and word ptr [ _Flags ][ bp ], 0fffeh ; clear carry bit.
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; switch to internal stack
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -