⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rxdos.asm

📁 dos source
💻 ASM
📖 第 1 页 / 共 5 页
字号:
        extrn CopyString                        : near
        extrn CopyBlock                         : near
        extrn convFCBNametoASCIZ                : near
        extrn convFilenametoFCBString           : near
        extrn getSysDateinDirFormat             : near
        extrn upperCase                         : near
        extrn lowerCase                         : near
        extrn __ascii_stosb                     : near
        extrn getMonthDayYear                   : near
        extrn getDaysSince1980                  : near
        extrn StringLength                      : near
        extrn condStringLength                  : near
        extrn getSystemDateValue                : near

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  DOS Data                                                     ;
        ;...............................................................;

RxDOS SEGMENT PARA PUBLIC 'CODE'
        assume cs:RxDOS, ds:RxDOS, es:RxDOS, ss:RxDOS

                        org 0000h

RxDOS_start:            jmp RxDOS_initialize
                        db 0
_RxDOS_SDALayoutStyle   db DOS5_SDASTYLE        ; DOS 4.0 + Style
_RxDOS_data             db 21 dup (0)           ; uninitialized

_RxDOS_ShareRetry       dw 0                    ; sharing retry count
_RxDOS_ShareDelay       dw 0                    ; sharing retry delay
_RxDOS_pDTA             dd 0                    ; ptr to current disk buffer (* violates m/tasking)
_RxDOS_UnreadCON        dw 0                    ; ptr to unread CON input
_RxDOS_pStartMemBlock   dw 0                    ; seg ptr to start of memory allocation

_RxDOS_pDPB             dd 0                    ; ptr to Drive Parameter Block (DPB)
_RxDOS_pFT              dd 0                    ; ptr to File Tables (FT)
_RxDOS_pCLOCKdriver     dd 0                    ; ptr to CLOCK$ device driver
_RxDOS_pCONdriver       dd 0                    ; ptr to CON device driver
_RxDOS_wMaxBlock        dw sizeSector           ; maximum bytes per block for any/all devices
_RxDOS_BufferList       dd 0                    ; pointer set for buffer list
_RxDOS_pCDS             dd 0                    ; ptr to array of current directory structures
_RxDOS_pFCBs            dd 0                    ; ptr to System FCB table
_RxDOS_nProtFCBs        dw 0                    ; number of protected fcbs (no longer supported)
_RxDOS_bNumBlockDev     db 0                    ; number of block devices
_RxDOS_bLastDrive       db 0                    ; lastdrive from config.sys

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  NULL Device Driver                                           ;
        ;...............................................................;

_RxDOS_NULLDev          dd -1                   ; link to other device
                        dw ( DEV_CHAR + DEV_NULL + DEV_FASTCHARIO )
                        dw null_strategy
                        dw null_interrupt
                        db 'NUL     '

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Installable File System Parameters                           ;
        ;...............................................................;

_RxDOS_bNumJoinDev      db 0                    ; number of JOIN'ed drives
_RxDOS_wSpecialNames    dw 0                    ; pointer to list of special names
_RxDOS_pSETVERList      dd 0                    ; pointer to SETVER program list
_RxDOS_wDOSHIGHOffset   dw 0                    ; DOS High offset A20 fix
                        dw 0                    ; DOS High PSP
_RxDOS_Buffers          dw 0                    ; BUFFERS x
_RxDOS_BuffersY         dw 0                    ; BUFFERS y (lookahead buffers)
_RxDOS_BootDrive        db 0                    ; Boot Drive (A: = 1, ...)
_RxDOS_MachineType      db 0                    ; 1 if 80386+, else 0   
_RxDOS_ExtendedMem      dw 0                    ; extended memory size in K

        ; the remainder of these arguments are not compatible with MS-DOS

_RxDOS_Verify           dw 0                    ; NonZero if Verify.
_RxDOS_AllocStrategy    dw 0                    ; Allocation strategy.
_RxDOS_bSwitchChar      db '/'                  ; Switch Char.
_RxDOS_MaxMemory        dw 0                    ; max memory
_RxDOS_NumFileHandles   dw sizePSPHandleTable   ; default
_RxDOS_Remainder        dw 0000                 ; div32 remainder.

_RxDOS_pExtErrorCode    dw 0                    ; Error code.
_RxDOS_ExtErrorFlag     dw 0                    ; flag if infor set
_RxDOS_ExtErrorInfo     db size ERROR dup(0)    ; extended error info
_RxDOS_AbortInProgress  dw 0                    ; if NZ, skip critical error

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Current PSP                                                  ;
        ;...............................................................;

                       even
_RxDOS_CurrentInstance  dw 0                    ; base address of current stack
_RxDOS_CurrentStackTop  dw RxDOS_StackTop       ; Reserved Stack Top ...
_RxDOS_CurrentStackBot  dw RxDOS_StackTop       ;       ... and Bottom.
_RxDOS_StackLongJump    dw 0                    ; long jump

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  UMB Control Status Word                                      ;
        ;...............................................................;

_RxDOS_UMBEnabled       dw 0                    ; set by init
_RxDOS_UMBAllowed       dw 0                    ; selectable by user

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Tab Expansion                                                ;
        ;...............................................................;

_RxDOS_TabPosition      dw 0                    ; tab position

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Country, Code Page, and Double Byte Character Set Info       ;
        ;...............................................................;

                       even
_RxDOS_UserCodePage     dw DEFAULT_CODEPAGE
_RxDOS_SystemCodePage   dw DEFAULT_CODEPAGE     ; system code page
_RxDOS_DBCS_Table       dw 0                    ; DBCS (NULL )

_RxDOS_UserCountryCode  dw DEFAULT_COUNTRYCODE  ; user set country
_RxDOS_SysCountryCode   dw DEFAULT_COUNTRYCODE  ; system country code
_RxDOS_SegCountryTables dw 0000                 ; if non-zero, country info table

_RxDOS_CurrCountryInfo  dw  DATE_USA 
                        db  '$', 0, 0, 0, 0     ; currency symbol (asciz)       5 bytes
                        dw  ','                 ; thousands separator           2 bytes
                        dw  '.'                 ; decimal separator             2 bytes
                        dw  '-'                 ; date separator                2 bytes
                        dw  ':'                 ; time separator                2 bytes
                        db  0                   ; currency format (before or after)
                        db  2                   ; places after decimal point
                        db  TIME_12HOUR         ; 12-hour or 24-hour format
                        dd RxDOS_USA_DefaultUpperCaseFunction                                
                        dw  ','                 ; data-list ...
                        db 10 dup(?)            ; reserved

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Command Shell                                                ;
        ;...............................................................;

                       even
_RxDOS_CommandShell     db 128 dup(?)
_RxDOS_SharedBuffer     db 128 dup (?)          ; shared buffer.

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Swappable Data Area                                          ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  Variables whose names begin with _RxDOS are used and will    ;
        ;  contain valid data. The remainder of the arguments are       ;
        ;  placeholders for compatibility reasons and are not used.     ;
        ;...............................................................;

SDABeginArea             equ $
_RxDOS_CritErrorFlag    db 0
_RxDOS_INDOSFlag        db 0                    ; INDOS flag.
_RxDOS_CritErrorDrive   db 0                    ; drive where crit error occurred
_RxDOS_LocusLasterror   db 0
_RxDOS_ExtErrorcode     dw 0
_RxDOS_SuggestedAction  db 0
_RxDOS_ClassOfError     db 0
SDApLastError           dd 0                    ; pointer for last error

SDACurrentDTA           dd 0                    ; current disk transfer address
_RxDOS_CurrentPSP       dw 0                    ; current PSP
SDASaveSP               dw 0                    ; SP across int 23h
_RxDOS_ChildReturnCode  dw 0                    ; Child return code.
_RxDOS_CurrentDrive     db 0                    ; current drive ( a=0, ... )
SDAExtendedBreakFlag    db 0                    ; extended break flag
SDAEndArea               equ $

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; Extended Swappable Data Area
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

_RxDOS_FunctionCall     dw 0                    ; AX on call
_RxDOS_PSPShare         dw 0
_RxDOS_MachineIDShare   dw 0

SDAFirstUsableAlloc     dw 0
SDABestUsableAlloc      dw 0
SDALastUsableAlloc      dw 0
SDAMemSizeinParas       dw 0
                        dw 0

SDAInt24_RetFailStatus  db 0
SDAInt24_AllowedActions db 0                    ; Abort, Retry, Fail bits
                        db 0
_RxDOS_bCtrlBreakCheck  dw 0                    ; Ctrl Break Flag.
                        db 0
SDADayOfMonth           db 0
SDAMonth                db 0
SDAYear                 dw 0                    ; year since 1980
SDADaysSince            dw 0                    ; since 1-1-1980
SDADayOfWeek            db 0                    ; 0 = Sunday

SDASFTValidPointer      db 0
SDAInt28_Safe           db 0
SDAInt24_Fail           db 0

SDADeviceDriverRequest  db 26 dup(0)
SDADeviceEntryPoint     dd 0
SDADeviceRequest01      db 22 dup(0)
SDADeviceRequest02      db 22 dup(0)

SDAPSPCopyType          dw 0                    ; not used by RxDOS
_RxDOS_UserSerialNumber db  0, 0, 0             ; User Identification
_RxDOS_DOSOEMVersion    db 94, 0, 0             ; OEM Version.

SDAClockTransfer        db 6 dup(0)             ; not used by RxDOS
SDATransferWord         dw 0                    ; not used

SDAFirstName            db sizeEXPANDNAME dup(0)
SDASecondName           db sizeEXPANDNAME dup(0)
SDAFindBlock            db 21 dup(0)
SDADirEntry             db 32 dup(0)
SDACDSCopy              db 81 dup(0)            ; not used by RxDOS
SDAFCBName              db 12 dup(0)            ; not used by RxDOS
SDAFCBRename            db 12 dup(0)            ; not used by RxDOS
                        db 8 dup(0)             ; not used by RxDOS

SDAExtendedAttrib       db 0                    ; not used by RxDOS
SDAFCBType              db 0                    ; not used by RxDOS
SDADirSearchAttrib      db 0                    ; not used by RxDOS
SDAFileOpenMode         db 0                    ; not used by RxDOS
                        dw 0, 0, 0              ; not used by RxDOS
SDAReadWriteFlag        db 0                    ; not used by RxDOS
SDADriveType            db 0                    ; not used by RxDOS
                        dw 0                    ; not used by RxDOS
SDALineEditInsert       db 0                    ; not used by RxDOS
SDAFileLocated          dw 0                    ; not used by RxDOS
SDATypeProcessTerm      dw 0                    ; not used by RxDOS
SDADeleteCode           db DIRENTRY_DELETED     ; not used by RxDOS

SDADPBPointer           dd 0                    ; not used by RxDOS
SDAUserStackFrame       dd 0                    ; not used by RxDOS
SDAInt24_SPSave         dd 0                    ; not used by RxDOS
                        dw 4 dup(0)             ; not used by RxDOS
SDAMediaID              dw 0                    ; not used by RxDOS
SDApCurrentDPB          dd 0                    ; not used by RxDOS
SDApCurrentSFT          dd 0                    ; not used by RxDOS
SDApCurrentCDS          dd 0                    ; not used by RxDOS
SDApCurrentFCB          dd 0                    ; not used by RxDOS
SDASFTHandle            dw 0, 0                 ; not used by RxDOS
SDApJobHandleTable      dd 0, 0                 ; not used by RxDOS
SDAPathNameLast         dw 0                    ; not used by RxDOS

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Stacks                                                       ;
        ;...............................................................;

                       even
RxDOS_StackProtect      dw 5E5Eh
                        dw 1024 dup(?)
RxDOS_StackTemp         dw 2048 dup(?)
RxDOS_StackTop          dw 5E5Eh

SDAExtendedSwapArea     equ $

        ; ** ROMABLE BEYOND THIS ADDRESS **

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Real Time Dos Product Identification                         ;
        ;...............................................................;

_RxDOS_DOSROMStatusFlag db ROM_IDENTIFICATION   ; ROM Version Status
_RxDOS_DOSVersion       db 6, 20                ; Dos Version (6.20)
_RxDOS_DOSProgramName   db 'RxDOS6.0'           ; Product Name.

_RxDOS_ContrlC_Message  db '^C', ControlM, ControlJ, 0

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Device Assign Table                                          ;
        ;...............................................................;

stdDeviceAssignTable:   StdRedirec  < 'AUX     ', -1, sftIsDevice >
                        StdRedirec  < 'CON     ', -1, sftIsDevice + sftIsstdout + sftIsstdin >
                        StdRedirec  < 'PRN     ', -1, sftIsDevice >
                        dw -1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -