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

📄 rxdos.asm

📁 dos source
💻 ASM
📖 第 1 页 / 共 5 页
字号:
        jnz _Interrupt_24_22                            ; if not fail -->
        mov dx, CRITERROR_FAIL
        test ah, CRITERROR_FAILALLOWED                  ; fail allowed ?
        jnz _Interrupt_24_36                            ; exit with fail -->

_Interrupt_24_22:
        cmp cl, "r"                                     ; Retry ?
        jnz _Interrupt_24_26                            ; if not retry -->
        mov dx, CRITERROR_RETRY
        test ah, CRITERROR_RETRYALLOWED                 ; retry allowed ?
        jnz _Interrupt_24_36                            ; exit with retry -->

_Interrupt_24_26:
        cmp cl, "i"                                     ; Ignore ?
        jnz _Interrupt_24_30                            ; if not ignore -->
        mov dx, CRITERROR_IGNORE
        test ah, CRITERROR_IGNOREALLOWED                ; ignore allowed ?
        jnz _Interrupt_24_36                            ; exit with ignore -->

_Interrupt_24_30:
        cmp cl, "a"                                     ; Abort ?
        jnz _Interrupt_24_08                            ; if not abort -->
        mov dx, CRITERROR_TERMINATE

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  Exit
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

_Interrupt_24_36:
        mov ax, dx                                      ; return value in ax
        pop dx                                          ; throw away allowed

        pop es
        pop ds

        clc                                             ; no exit flag
        ret 2                                           ; returns to appl (iret w/o status)
_Interrupt_24   endp

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  Display New Line
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

_CritErrorDisplayNewLine:

        push di
        mov al, ControlM
        int 29h
        mov al, ControlJ
        int 29h

        pop di
     ;  jmp short _CritErrorDisplayMessage

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  Display Message
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

_CritErrorDisplayMessage:

        mov al, byte ptr [ di ]
        or al, al
        jz _CritErrorDisp_08

        int 29h
        inc di
        jmp _CritErrorDisplayMessage

_CritErrorDisp_08:
        ret

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  Abort, Retry, Ignore
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

CritError_AbortRetryIgnoreFail:
        db "Abort, Retry, Ignore, Fail ?", 0

CritError_AbortRetryIgnore:
        db "Abort, Retry, Ignore ?", 0

;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;  Critical Error Messages
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

CriticalErrorMessages:
        dw perr_devErrWriteProtectViol
        dw perr_devErrUnknownUnit
        dw perr_devErrDeviceNotReady
        dw perr_devErrUnknownCommand
        dw perr_devErrCRCerr
        dw perr_devErrBadDriveReq
        dw perr_devErrSeekError
        dw perr_devErrUnknownMedia
        dw perr_devErrSectorNotFound
        dw perr_devErrPrinterOutPaper
        dw perr_devErrWriteFault
        dw perr_devErrReadFault
        dw perr_devErrGeneralFailure
        dw perr_devErrSharingViolation
        dw perr_devErrLockViolation
        dw perr_devErrInvalidDiskChange

perr_devErrWriteProtectViol:
        db "Error Write Protect", 0

perr_devErrUnknownUnit:
        db "Error Unknown Unit", 0

perr_devErrDeviceNotReady:
        db "Error Device Not Ready", 0

perr_devErrUnknownCommand:
        db "Error Unknown Command", 0

perr_devErrCRCerr:
        db "Error CRC Error", 0

perr_devErrBadDriveReq:
        db "Error Bad Drive Request", 0

perr_devErrSeekError:
        db "Error Seek Error", 0

perr_devErrUnknownMedia:
        db "Error Unknown Media", 0

perr_devErrSectorNotFound:
        db "Error Sector Not Found", 0

perr_devErrPrinterOutPaper:
        db "Error Printer Out Paper", 0

perr_devErrWriteFault:
        db "Error Write Fault", 0

perr_devErrReadFault:
        db "Error Read Fault", 0

perr_devErrGeneralFailure:
        db "Error General Failure", 0

perr_devErrSharingViolation:
        db "Error Sharing Violation", 0

perr_devErrLockViolation:
        db "Error Lock Violation", 0

perr_devErrInvalidDiskChange:
        db "Error Invalid Disk Change", 0

perr_OnDrive:
        db " On Drive ", 0

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Interrupt 25 - Read From Disk                                ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  Like MSDOS, the Int 25 and 26 definitions do not  allow  for ;
        ;  32 bit sector addressing.  These functions support only disk ;
        ;  drives up to 32 MByte storage.                               ;
        ;                                                               ;
        ;  To access > 32 MByte disks, use the device driver calls.     ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  Usage:                                                       ;
        ;   al     drive (0= A, ... )                                   ;
        ;   cx     sectors                                              ;
        ;   dx     physical disk sector address                         ;
        ;   ds:bx  buffer address                                       ;
        ;                                                               ;
        ;...............................................................;

_Interrupt_25   proc far

        saveSegments di, si, bp, dx, cx, bx

        push ds
        push bx
        pop di
        pop es                                          ; buffer to es: di

        mov bx, cx                                      ; sectors
        xor cx, cx                                      ; extended sector address
        cmp bx, -1                                      ; points to DISKIO struct ?
        jnz _Int25_06                                   ; no -->

        mov bx, word ptr [ diskioSectors            ][ di ]
        mov cx, word ptr [ diskioStartSector. _high ][ di ]
        mov dx, word ptr [ diskioStartSector. _low  ][ di ]
        mov es, word ptr [ diskioBuffer. _segment   ][ di ]
        mov di, word ptr [ diskioBuffer. _pointer   ][ di ]

_Int25_06:
        or bx, bx                                       ; nothing to read ?
        jz _Int25_08                                    ; if none -->

        call DevRead

_Int25_08:
        restoreSegments bx, cx, dx, bp, si, di
        retf

_Interrupt_25   endp

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Interrupt 26 - Write To Disk                                 ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  Like MSDOS, the Int 25 and 26 definitions do not  allow  for ;
        ;  32 bit sector addressing.  These functions support only disk ;
        ;  drives up to 32 MByte storage.                               ;
        ;                                                               ;
        ;  To access > 32 MByte disks, use the device driver calls.     ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  Usage:                                                       ;
        ;   al     drive (0= A, ... )                                   ;
        ;   cx     sectors                                              ;
        ;   dx     physical disk sector address                         ;
        ;   ds:bx  buffer address                                       ;
        ;                                                               ;
        ;...............................................................;

_Interrupt_26   proc far

        saveSegments di, si, bp, dx, cx, bx

        push ds
        push bx
        pop di
        pop es                                          ; buffer to es: di

        mov bx, cx                                      ; sectors
        xor cx, cx                                      ; extended sector address
        cmp bx, -1                                      ; points to DISKIO struct ?
        jnz _Int26_06                                   ; no -->

        mov bx, word ptr [ diskioSectors            ][ di ]
        mov cx, word ptr [ diskioStartSector. _high ][ di ]
        mov dx, word ptr [ diskioStartSector. _low  ][ di ]
        mov es, word ptr [ diskioBuffer. _segment   ][ di ]
        mov di, word ptr [ diskioBuffer. _pointer   ][ di ]

_Int26_06:
        or bx, bx                                       ; nothing to write ?
        jz _Int26_08                                    ; if none -->
        call DevWrite

_Int26_08:
        restoreSegments bx, cx, dx, bp, si, di
        retf

_Interrupt_26   endp

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Interrupt 27                                                 ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  Terminate Stay Resident                                      ;
        ;...............................................................;

_Interrupt_27   proc far

        Int21 TerminateStayResident, 00                 ; no return code

_Interrupt_27   endp

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Interrupt 28                                                 ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  Idle Loop                                                    ;
        ;...............

⌨️ 快捷键说明

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