diff options
| author | 2024-04-25 21:24:10 +0100 | |
|---|---|---|
| committer | 2024-04-25 22:32:27 +0000 | |
| commit | 2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch) | |
| tree | 80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/MAPPER/SETINT24.ASM | |
| parent | Merge pull request #430 from jpbaltazar/typoptbr (diff) | |
| download | ms-dos-main.tar.gz ms-dos-main.tar.xz ms-dos-main.zip | |
Diffstat (limited to 'v4.0/src/MAPPER/SETINT24.ASM')
| -rw-r--r-- | v4.0/src/MAPPER/SETINT24.ASM | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/SETINT24.ASM b/v4.0/src/MAPPER/SETINT24.ASM new file mode 100644 index 0000000..9e3e8d8 --- /dev/null +++ b/v4.0/src/MAPPER/SETINT24.ASM | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | ;0 | ||
| 2 | page 80,132 | ||
| 3 | |||
| 4 | ;********************************************************************** | ||
| 5 | ;* | ||
| 6 | ;* MODULE: set_int24_vector | ||
| 7 | ;* | ||
| 8 | ;* Critical error handler for C programs BACKUP and RESTORE | ||
| 9 | ;* | ||
| 10 | ;********************************************************************* | ||
| 11 | ;------------------------------------------------------------;;;;AN000; | ||
| 12 | databuff segment public 'databuff' ;;;;AN000; | ||
| 13 | databuff ends ;;;;AN000; | ||
| 14 | ;------------------------------------------------------------;;;;AN000; | ||
| 15 | |||
| 16 | |||
| 17 | dosxxx segment byte public 'dos' ;AN000; | ||
| 18 | assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing ;AN000; | ||
| 19 | |||
| 20 | |||
| 21 | public set_int24_vector ;AN000; | ||
| 22 | .sall ;AN000; | ||
| 23 | .xlist ;AN000; | ||
| 24 | include macros.inc ;AN000; | ||
| 25 | .list ;AN000; | ||
| 26 | |||
| 27 | str struc ;AN000; | ||
| 28 | old_bp dw ? ;AN000; | ||
| 29 | Return dd ? ;AN000; | ||
| 30 | Flag dw ? ;AN000; | ||
| 31 | str ends ;AN000; | ||
| 32 | |||
| 33 | |||
| 34 | set_int24_vector proc far ;AN000; | ||
| 35 | Enter set_int24_vector ;AN000; | ||
| 36 | |||
| 37 | mov ax,seg databuff ;AN000; | ||
| 38 | mov ds,ax ;AN000; | ||
| 39 | assume ds:databuff ;AN000; | ||
| 40 | |||
| 41 | mov ax,03524h ;Get Int24 Vector ;AN000; | ||
| 42 | int 21h ;AN000; | ||
| 43 | ;Save it | ||
| 44 | mov word ptr cs:OldInt24,bx ;AN000; | ||
| 45 | mov word ptr cs:OldInt24+2,es ;AN000; | ||
| 46 | |||
| 47 | ;Get address of my Int24 Handler | ||
| 48 | mov dx,cs ;AN000; | ||
| 49 | mov ds,dx ;AN000; | ||
| 50 | mov dx,offset AppErrorHandler ;AN000; | ||
| 51 | |||
| 52 | mov ax,02524H ;Set new INT24 vector ;AN000; | ||
| 53 | int 21h ;AN000; | ||
| 54 | |||
| 55 | xor ax,ax ;Set good error return ;AN000; | ||
| 56 | |||
| 57 | exit: mexit ; pop all registers ;AN000; | ||
| 58 | ret size str - 6 ; return ;AN000; | ||
| 59 | |||
| 60 | set_int24_vector endp ;AN000; | ||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | ;------------------------------------------------------- | ||
| 67 | ; | ||
| 68 | ; **** Error Handler ****** | ||
| 69 | ; | ||
| 70 | ;------------------------------------------------------- | ||
| 71 | Ignore equ 0 ;AN000; | ||
| 72 | Retry equ 1 ;AN000; | ||
| 73 | Abort equ 2 ;AN000; | ||
| 74 | Fail equ 3 ;AN000; | ||
| 75 | |||
| 76 | OldInt24 dd ? ;AN000; ;save old interrupt handler address ;;; | ||
| 77 | |||
| 78 | AppErrorHandler proc near ;AN000; | ||
| 79 | pushf ;AN000; | ||
| 80 | call dword ptr cs:OldInt24 ;AN000; Get user to respond | ||
| 81 | cmp al,Abort ;AN000; For any resonse other than Abort | ||
| 82 | jne rett ;AN000; retry the operation | ||
| 83 | |||
| 84 | int 023h ;AN000; | ||
| 85 | |||
| 86 | rett: ;AN000; | ||
| 87 | iret ;AN000; return to caller | ||
| 88 | AppErrorHandler endp ;AN000; | ||
| 89 | ;------------------------------------------------------- | ||
| 90 | ;------------------------------------------------------- | ||
| 91 | |||
| 92 | dosxxx ends ;AN000; | ||
| 93 | end ;AN000; | ||
| 94 | \ No newline at end of file | ||