1; This code released to the public domain by Matthew Parker
2
3.model large, c
4
5ifdef WATCOM
6install24h EQU _install24h
7remove24h  EQU _remove24h
8endif
9
10public install24h, remove24h
11
12.code
13
14install24h proc
15    push    ds
16    push    es
17    mov     ax,3524h             ;Get address of int 24h
18    int     21h
19    mov     word ptr[old24h],bx  ;Store old address for later use
20    mov     word ptr[old24h+2],es
21    push    cs
22    pop     ds
23    mov     dx,offset int24h
24    mov     ax,2524h
25    int     21h
26    pop     es
27    pop     ds
28    ret
29install24h endp
30
31remove24h proc
32    push    ds
33    lds     dx,[old24h]
34    mov     ax,2524h
35    int     21h
36    pop     ds
37    ret
38remove24h endp
39
40int24h proc
41    mov    al,3  ;Fail disk operation
42    iret
43int24h endp
44
45.data
46
47old24h     dd ?
48
49end
50