summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/KEYB/KEYBI48.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/CMD/KEYB/KEYBI48.ASM')
-rw-r--r--v4.0/src/CMD/KEYB/KEYBI48.ASM174
1 files changed, 174 insertions, 0 deletions
diff --git a/v4.0/src/CMD/KEYB/KEYBI48.ASM b/v4.0/src/CMD/KEYB/KEYBI48.ASM
new file mode 100644
index 0000000..05ed786
--- /dev/null
+++ b/v4.0/src/CMD/KEYB/KEYBI48.ASM
@@ -0,0 +1,174 @@
1
2
3 PAGE ,132
4 TITLE DOS - KEYB Command - Interrupt 48H Handler
5
6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7;; DOS - NLS Support - KEYB Command
8;; (C) Copyright 1988 Microsoft
9;;
10;; File Name: KEYBI48.ASM
11;; ----------
12;;
13;; Description:
14;; ------------
15;; Contains Interrupt 48H handler.
16;;
17;; Documentation Reference:
18;; ------------------------
19;; PC DOS 3.3 Detailed Design Document - May ?? 1986
20;;
21;; Procedures Contained in This File:
22;; ----------------------------------
23;;
24;; Include Files Required:
25;; -----------------------
26;; INCLUDE KEYBEQU.INC
27;; INCLUDE KEYBSHAR.INC
28;; INCLUDE KEYBMAC.INC
29;; INCLUDE KEYBCMD.INC
30;; INCLUDE KEYBCPSD.INC
31;; INCLUDE POSTEQU.inc
32;; INCLUDE DSEG.inc
33;;
34;; External Procedure References:
35;; ------------------------------
36;; FROM FILE ????????.ASM:
37;; procedure - description????????????????????????????????
38;;
39;; Linkage Information: Refer to file KEYB.ASM
40;; --------------------
41;;
42;; Change History:
43;; ---------------
44;;
45;;
46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
47 ;;
48 INCLUDE KEYBEQU.INC ;;
49 INCLUDE KEYBSHAR.INC ;;
50 INCLUDE KEYBMAC.INC ;;
51 INCLUDE KEYBCMD.INC ;;
52 INCLUDE KEYBCPSD.INC ;;
53 INCLUDE POSTEQU.inc ;;
54 INCLUDE DSEG.inc ;;
55 ;;
56 PUBLIC KEYB_INT_48 ;;
57 ;;
58 EXTRN ERROR_BEEP:NEAR ;;
59 ;;
60CODE SEGMENT PUBLIC 'CODE' ;;
61 ;;
62 ASSUME CS:CODE,DS:CODE,ES:DATA;;
63 ;;
64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
65;;
66;; Module: KEYB_INT_48
67;;
68;; Description:
69;;
70;; Input Registers:
71;; AL := Scan Code
72;;
73;; Output Registers:
74;; N/A
75;;
76;; Logic:
77;; IF scan code is not a break code THEN
78;; IF CNTL was not entered THEN
79;; IF ALT+SHIFT was pressed THEN
80;; Set JB_KB_FLAG in SHARED_DATA_AREA
81;; Clear ALT and SHIFT states in KB_FLAG
82;; IRET or JMP to a chained INT48 routine
83;;
84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
85 ;;
86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
87;; Program Code
88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
89 ;;
90KEYB_INT_48 PROC ;;
91 ;;
92 STI ;; allow NON-KB interrupts
93 PUSH BX ;;
94 PUSH BP ;;
95 PUSH CX ;;
96 PUSH DX ;;
97 PUSH DI ;;
98 PUSH SI ;;
99 PUSH DS ;;
100 PUSH ES ;;
101 PUSH AX ;;
102 ;;
103 MOV SD.JR_KB_FLAG,0 ;; Clear the flag
104 ;;
105 CMP AL,80H ;; Test for break code
106 JA INT48_EXIT ;; IF not a break code THEN
107 ;;
108 PUSH DS ;; Save segment registers
109 PUSH ES ;;
110 ;;
111 PUSH CS ;; Set up addressing
112 POP DS ;; for DATA SEGMENT (=CODE SEGMENT)
113 MOV BX,DATA ;; Set up addressing
114 MOV ES,BX ;; for EXTRA SEGMENT (=BIOS RAM AREA)
115 ;;
116 MOV AH,KB_FLAG ;; Get the flag status
117 AND AH,0FH ;; Clear all shift states
118 ;;
119 TEST AH,CTL_SHIFT ;; Test if CNTL was entered?
120 JNE INT48_PASS ;;;;;;;;;;;;;;;; IF yes THEN
121 ;; pass to ROM INT48
122 AND AH,ALT_SHIFT+RIGHT_SHIFT+LEFT_SHIFT ;; Test if both ALT and
123 CMP AH,ALT_SHIFT ;; SHIFT were pressed
124 JBE INT48_PASS ;; IF no THEN
125 ;; pass to ROM INT48
126 MOV BH,KB_FLAG ;;;;;;;;;;;; IF yes then
127 MOV SD.JR_KB_FLAG,BH ;; Setup JR flag
128 AND SD.JR_KB_FLAG,ALT_SHIFT+RIGHT_SHIFT+LEFT_SHIFT ;; Pass flags
129 ;; (ALT and
130 ;;;;;;;;;;;;;;;;;;;;;;;;;; EITHER/BOTH SHIFT)
131 XOR KB_FLAG,AH ;; Clear the ALT state and SHIFT state
132 ;; Reset the KB_FLAG to permit
133 ;; third shifts to go through
134INT48_PASS: ;;
135 POP ES ;;
136 POP DS ;;
137 ;;;;;;;
138INT48_EXIT: ;;
139 CMP WORD PTR CS:SD.OLD_INT_48,0 ;; Q..are we the last in the chain?
140 JNE INT_48_JMP ;; N..call next in chain
141 CMP WORD PTR CS:SD.OLD_INT_48+2,0 ;; Q..are we the last in the chain?
142 JNE INT_48_JMP ;; N..call next in chain
143 ;;;;;;;
144 POP AX ;; restore regs
145 POP ES ;;
146 POP DS ;;
147 POP SI ;;
148 POP DI ;;
149 POP DX ;;
150 POP CX ;;
151 POP BP ;;
152 POP BX ;;
153 ;;
154 IRET ;; Y..return to caller
155 ;;
156INT_48_JMP: ;;
157 ;;
158 POP AX ;; restore regs
159 POP ES ;;
160 POP DS ;;
161 POP SI ;;
162 POP DI ;;
163 POP DX ;;
164 POP CX ;;
165 POP BP ;;
166 POP BX ;;
167 ;;
168 JMP CS:SD.OLD_INT_48 ;;
169 ;;
170KEYB_INT_48 ENDP ;;
171;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
172
173CODE ENDS
174 END