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

📄 rxdosini.asm

📁 dos source
💻 ASM
📖 第 1 页 / 共 5 页
字号:

        mov si, offset _RxDOS_ConfigKeywords
        call _findCommand
        jnc configProcessing_20

      ; typeout msgUnknownCommandinConfig
        jmp configProcessing_12

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  [ blockitem_name ]
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
configProcessing_16:
        inc di
        call _skipSpaces                                ; skip any leading spaces

        push di
        call _scanToEndofName                           ; find terminating space
        mov byte ptr ss:[ di ], 0                       ; set a terminator

        pop di
        mov dx, CONFIGTYPE_MENUBLOCK                    ; menu block 

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  go save statement
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
configProcessing_20:
        cmp dx, CONFIGTYPE_REM                          ; remark statement ?
        jz configProcessing_12                          ; ignore -->

        cmp dx, CONFIGTYPE_COMMENTS                     ; if comment, go process
        jz configProcessing_26                          ; process comment -->

        lea si, offset _linebuffer [ bp ]
        getarg cx, _charsread
        sub cx, di
        add cx, si                                      ; length difference to remember
        mov si, di                                      ; source pointer

        getdarg es, di, _configNextLine
        mov word ptr es:[ configType   ][ di ], dx      ; save type

        mov ax, word ptr [ _linenumber ][ bp ]          ; get line number
        mov word ptr es:[ configLineNumber ][ di ], ax

        mov word ptr es:[ configLength ][ di ], cx
        add word ptr es:[ configLength ][ di ], (size CONFIGLINE)

     ; copy statement

        lea di, offset [ configStatement   ][ di ]      ; offset to statement
        rep movsb
        
        xor ax, ax
        stosb                                           ; null terminate

        mov di, word ptr [ _configNextLine ][ bp ]
        add di, word ptr es:[ configLength  ][ di ]     ; advance beyond type
        mov word ptr [ _configNextLine ][ bp ], di
        jmp configProcessing_12

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  process menu
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
configProcessing_26:
        call _skipSpaces                                ; skip any leading spaces

        mov ax, word ptr es:[ di ]                      ; get comment character
        cmp ah, ' ' + 1                                 ; space or other control ?
        jnc configProcessing_28                         ; no -->
        mov ah, 0

configProcessing_28:
        storarg _comment, ax                            ; save comment character(s)
        jmp configProcessing_12                         ; continue

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  process menu
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
configProcessing_36:
        getdarg es, di, _configStatements
        call configMenu

        getdarg es, di, _configStatements
        call removeUnusedBlocks

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  reconfigure system
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        getdarg es, di, _configStatements

        call processSwitchChar                          ; SwitchChar = 
        call processNumLock                             ; NumLock = on | off
        call processDOS                                 ; dos =
        storarg _dosFlags, ax                           ; save flags
        call RxDOSini_MemorySubSystem                   ; re-initialize memory subsystem

        call processBuffers                             ; buffers =
        call processFCBS                                ; fcbs =
        call processFiles                               ; files = 
        call processStack                               ; stacks =

        call processLastDrive                           ; lastdrive =
        call processDrivParam                           ; drivparam = 
        call processMultiTrack                          ; multitrack = 

        call processBreak                               ; break = on | off
        call processCountry                             ; country = 
        call processSwitches                            ; switches =
        call processShell                               ; shell =

        getdarg es, di, _configStatements
        call processDevice                              ; device devicename [ options ]

        getarg ax, _dosFlags                            ; option flags
        call RxDOSini_LinkUpperMemory                   ; attempt link upper memory

        getdarg es, di, _configStatements
        call processDeviceHigh                          ; device devicename [ options ]

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  Return
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
configProcessing_Return:

        Return

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Process Unsupported Commands                                 ;
        ;...............................................................;

RxDOSini_LinkUpperMemory:

processCountry:
processDrivParam:
processMultiTrack:
processSwitches:

        ret                                             ; ignores entire line

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Process Break Statement                                      ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  es:di  start of statements in saved config buffer            ;
        ;...............................................................;

processBreak:

        Entry
        ddef _ConfigStatements, es, di
        def  _break, _OFF                               ; 0 is off; 1 is on.

processBreak_08:
        mov ax, CONFIGTYPE_BREAK
        call _findStatementType                         ; find statement type
        jc processBreak_24                              ; if no more -->

        push es
        push di
        lea di, offset [ configStatement ][ di ]
        call ConfigPrompt                               ; check for ?= or F8 case
        jc processBreak_12                              ; ignore statement -->
        
        mov si, offset _RxDOS_ConfigOnOff
        call _findCommand                               ; locate on or off
        jc processBreak_12                              ; if none of the above -->
        storarg _break, dx                              ; else ok to save

processBreak_12:
        pop di
        pop es
        or word ptr es:[ configFlags ][ di ], CONFIGFLAG_PROCESSED
        add di, word ptr es:[ configLength ][ di ]
        jmp processBreak_08

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  return
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
processBreak_24:
        getarg ax, _break                               ; get break
        mov byte ptr [ _RxDOS_bCtrlBreakCheck ], al

        getdarg es, di, _ConfigStatements               ; 
        Return

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Process Buffer Statements                                    ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  es:di  start of statements in saved config buffer            ;
        ;...............................................................;

processBuffers:

        Entry
        ddef _ConfigStatements, es, di
        ddef _buffers, 0, DEFAULT_BUFFERS

processBuffers_08:
        mov ax, CONFIGTYPE_BUFFERS
        call _findStatementType                         ; find statement type
        jc processBuffers_24                            ; if no more -->

        push es
        push di
        lea di, offset [ configStatement ][ di ]
        call ConfigPrompt                               ; check for ?= or F8 case
        jc processBuffers_16                            ; ignore statement -->
        
        mov cx, 1
        mov dx, CONFIGMAX_BUFFERS
        call _getNumber
        jc processBuffers_16                            ; if beyond range -->
        mov word ptr [ _buffers. _low  ][ bp ], ax      ; else ok to save

        mov cx, 0
        mov dx, ax                                      ; highest cannot exceed prev number
        call _getNumber
        jc processBuffers_16                            ; if beyond range -->
        mov word ptr [ _buffers. _high ][ bp ], ax      ; else ok to save

processBuffers_16:
        pop di
        pop es
        or word ptr es:[ configFlags ][ di ], CONFIGFLAG_PROCESSED
        add di, word ptr es:[ configLength ][ di ]
        jmp processBuffers_08

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  return
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
processBuffers_24:
        getdarg dx, ax, _buffers
        mov word ptr [ _RxDOS_Buffers. _low  ], ax
        mov word ptr [ _RxDOS_Buffers. _high ], dx
        call RxDOSini_CCBSubSystem                      ; reconfigure

        getdarg es, di, _ConfigStatements               ; 
        Return

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Process Device Statement(s)                                  ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  es:di  start of statements in saved config buffer            ;
        ;...............................................................;

processDevice:
        mov ax, CONFIGTYPE_DEVICE
        jmp processAnyDevice

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Process DeviceHigh Statement(s)                              ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  es:di  start of statements in saved config buffer            ;
        ;...............................................................;

processDeviceHigh:

        Entry
        ddef _ConfigStatements, es, di
        def  _memorystrategy

        Int21 GetAllocationStrategy                     ; get current allocation scheme
        storarg _memorystrategy, ax

        mov bx, _MEM_FIRSTFIT_HIGH
        Int21 SetAllocationStrategy

        mov ax, CONFIGTYPE_DEVICEHIGH
        getdarg es, di, _ConfigStatements
        call processAnyDevice

        getarg bx, _memorystrategy
        Int21 SetAllocationStrategy
        Return

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Common Device Load                                           ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  es:di  start of statements in saved config buffer            ;
        ;...............................................................;

processAnyDevice:

        Entry
        def  _type, ax
        def  _SegAddress
        def  _SegSize, -1

        ddef _ptrInitCommandLine
        ddef _ConfigStatements, es, di
        ddef _CurrentStatement
        ddef _ExecBlock
        ddef _strategy
        ddef _interrupt
        ddef _loadSize

        defbytes reqBlock, sizeINITReqHeader
        defbytes _devicename, 128
        defbytes _arguments, 128

processAnyDevice_08:

⌨️ 快捷键说明

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