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/DOS/CRIT.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/DOS/CRIT.ASM')
| -rw-r--r-- | v4.0/src/DOS/CRIT.ASM | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/v4.0/src/DOS/CRIT.ASM b/v4.0/src/DOS/CRIT.ASM new file mode 100644 index 0000000..dfb1ccd --- /dev/null +++ b/v4.0/src/DOS/CRIT.ASM | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | ; SCCSID = @(#)crit.asm 1.1 85/04/10 | ||
| 2 | TITLE CRIT - Critical Section Routines | ||
| 3 | NAME CRIT | ||
| 4 | ; | ||
| 5 | ; Critical Section Routines | ||
| 6 | ; | ||
| 7 | ; Critical section handlers | ||
| 8 | ; | ||
| 9 | ; Modification history: | ||
| 10 | ; | ||
| 11 | ; Created: ARR 30 March 1983 | ||
| 12 | ; | ||
| 13 | |||
| 14 | .xlist | ||
| 15 | ; | ||
| 16 | ; get the appropriate segment definitions | ||
| 17 | ; | ||
| 18 | include dosseg.asm | ||
| 19 | |||
| 20 | CODE SEGMENT BYTE PUBLIC 'CODE' | ||
| 21 | ASSUME SS:NOTHING,CS:DOSGROUP | ||
| 22 | |||
| 23 | .xcref | ||
| 24 | INCLUDE DOSSYM.INC | ||
| 25 | .cref | ||
| 26 | .list | ||
| 27 | |||
| 28 | I_need User_In_AX,WORD | ||
| 29 | i_need CurrentPDB,WORD | ||
| 30 | if debug | ||
| 31 | I_need BugLev,WORD | ||
| 32 | I_need BugTyp,WORD | ||
| 33 | include bugtyp.asm | ||
| 34 | endif | ||
| 35 | |||
| 36 | Break <Critical section handlers> | ||
| 37 | |||
| 38 | ; | ||
| 39 | ; Each handler must leave everything untouched; including flags! | ||
| 40 | ; | ||
| 41 | ; Sleaze for time savings: first instruction is a return. This is patched | ||
| 42 | ; by the sharer to be a PUSH AX to complete the correct routines. | ||
| 43 | ; | ||
| 44 | Procedure EcritDisk,NEAR | ||
| 45 | public EcritMem | ||
| 46 | public EcritSFT | ||
| 47 | ECritMEM LABEL NEAR | ||
| 48 | ECritSFT LABEL NEAR | ||
| 49 | RET | ||
| 50 | ; PUSH AX | ||
| 51 | fmt TypSect,LevReq,<"PDB $x entering $x">,<CurrentPDB,sect> | ||
| 52 | MOV AX,8000h+critDisk | ||
| 53 | INT int_ibm | ||
| 54 | POP AX | ||
| 55 | return | ||
| 56 | EndProc EcritDisk | ||
| 57 | |||
| 58 | Procedure LcritDisk,NEAR | ||
| 59 | public LcritMem | ||
| 60 | public LcritSFT | ||
| 61 | LCritMEM LABEL NEAR | ||
| 62 | LCritSFT LABEL NEAR | ||
| 63 | RET | ||
| 64 | ; PUSH AX | ||
| 65 | fmt TypSect,LevReq,<"PDB $x entering $x">,<CurrentPDB,sect> | ||
| 66 | MOV AX,8100h+critDisk | ||
| 67 | INT int_ibm | ||
| 68 | POP AX | ||
| 69 | return | ||
| 70 | EndProc LcritDisk | ||
| 71 | |||
| 72 | Procedure EcritDevice,NEAR | ||
| 73 | RET | ||
| 74 | ; PUSH AX | ||
| 75 | fmt TypSect,LevReq,<"PDB $x entering $x">,<CurrentPDB,sect> | ||
| 76 | MOV AX,8000h+critDevice | ||
| 77 | INT int_ibm | ||
| 78 | POP AX | ||
| 79 | return | ||
| 80 | EndProc EcritDevice | ||
| 81 | |||
| 82 | Procedure LcritDevice,NEAR | ||
| 83 | RET | ||
| 84 | ; PUSH AX | ||
| 85 | MOV AX,8100h+critDevice | ||
| 86 | INT int_ibm | ||
| 87 | POP AX | ||
| 88 | return | ||
| 89 | EndProc LcritDevice | ||
| 90 | |||
| 91 | CODE ENDS | ||
| 92 | END | ||