summaryrefslogtreecommitdiff
path: root/v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC')
-rw-r--r--v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC304
1 files changed, 304 insertions, 0 deletions
diff --git a/v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC b/v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC
new file mode 100644
index 0000000..d7ac257
--- /dev/null
+++ b/v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC
@@ -0,0 +1,304 @@
1.XLIST
2
3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4;; DOS - - NLS Support - KEYB Command
5;; (C) Copyright 1988 Microsoft
6;;
7;; File Name: KEYBSHAR.INC
8;; ----------
9;;
10;; Description:
11;; ------------
12;; Include file containing structure definitions Shared Data Area
13;; for the Shared Data Area.
14;; The Shared Data Area contains data which is required by
15;; both the resident and transient KEYB code. The Shared
16;; Data Area is allocated in the KEYBI2F file and will be
17;; resident following initial installation.
18;;
19;; Change History:
20;; ---------------
21;;
22;;
23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24 ;;
25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26;; SHARED_DATA_STR defines the initial fixed length portion of the
27;; Shared Data Area.
28;; Tables are loaded beginning at TABLE_AREA in the following order:
29;; State Logic
30;; Common Translate Section
31;; Specific Translate Sections for
32;; each code page
33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34 ;; SPECIAL_FEATURES equates:
35TYPEWRITER_CAPS_LK EQU 8000H ;; typewriter style caps lock
36JR_HOT_KEY_1_2 EQU 4000H ;; on PCjr use 1/2 as the hot keys
37 ;; instead of F1/F2
38 ;;
39 ;; Some useful scan codes:
40F1_SCAN EQU 59 ;; F1
41F2_SCAN EQU 60 ;; F2
42ONE_SCAN EQU 2 ;; "1"
43TWO_SCAN EQU 3 ;; "2"
44 ;;
45 ;; SYSTEM_FLAG equates:
46EXT_16 EQU 8000H ;; extended int16 support is there
47PC_AT EQU 4000H ;; code for pcat
48PC_LAP EQU 2000H ;; code for pc lap computer (p-12)
49PC_XT EQU 1000H ;; code for PC, PC/XT, PORTABLE
50PC_JR EQU 0800H ;; code for PCjr
51PC_PAL EQU 0400H ;; code for ???
52PC_386 EQU 0200H ;; code for ???
53PC_NET EQU 0100H ;; PC Net is installed
54 ;;
55 ;; HOT_KEY_FLAG EQUATES:
56US_MODE EQU 0 ;; hot key is active => US
57LANG_MODE EQU 0FFH ;; hot key is inactive
58 ;;
59 ;; -----------------------------------
60SHARED_DATA_STR STRUC ;; SHARED DATA AREA
61 ;;
62OLD_INT_9 DD 0 ;; saved int 9 vector
63OLD_INT_2F DD 0 ;; saved int 2F vector
64OLD_INT_48 DD 0 ;; saved int 48 vector (if PCjr)
65KEYB_TYPE DW 0 ;; type of keyboard
66SYSTEM_FLAG DW 0 ;; system configuration flags
67TABLE_OK DB 0 ;; flag to INT 9 that table is built
68JR_KB_FLAG DB 0 ;; flag for special PCjr processing
69 DB 4 DUP(0) ;; reserved
70 ;;
71 ;; Table copy begins here:
72ACTIVE_LANGUAGE DB 'US' ;; language code
73INVOKED_CP_TABLE DW 437 ;; ptr to table for invoked code page
74ACTIVE_XLAT_PTR DW -1 ;; ptr to active Specific Translate Sect
75FIRST_XLAT_PTR DW -1 ;; ptr to first Specific Translate Sect
76RESIDENT_END DW 0ffffh ;; offset of last byte in resident mem
77LOGIC_PTR DW -1 ;; ptr to State Logic
78COMMON_XLAT_PTR DW -1 ;; ptr to Common Translate Section
79SPECIAL_FEATURES DW ? ;; special Features
80TABLE_OVERFLOW DB 0 ;; overflow flag for table rebuild
81HOT_KEY_ON_SCAN DB ? ;; scan codes to use with ALT+CTRL
82HOT_KEY_OFF_SCAN DB ? ;; to turn hot key on and off
83 DB 4 DUP(0) ;; reserved
84TABLE_AREA DB ? ;; tables loaded here:
85 ;; State Logic
86 ;; Common Translate Section
87 ;; Specific Translate Sections for
88 ;; each code page
89SHARED_DATA_STR ENDS ;;
90 ;;
91 ;;
92 ;;
93;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94;; State Logic equates.
95;; Contains equates for our NLS Flags and for the State Logic
96;; commands.
97;; State Logic command macros are defined in KEYBMAC.INC
98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
99 ;;
100STATE_LOGIC_STR STRUC ;;
101 ;;
102SL_LOGIC_LEN DW ? ;; length of state logic
103SL_SPECIAL_FEATURES DW ? ;;
104SL_LOGIC_CMDS DB 0 ;; state logic commands begin here
105 ;;
106STATE_LOGIC_STR ENDS ;;
107 ;;
108 ;;
109NUM_BIOS_FLAGS EQU 4 ;;
110NUM_NLS_FLAGS EQU 2 ;; '+1' below is the EXT_KB_FLAG
111NUM_FLAGS EQU NUM_BIOS_FLAGS+NUM_NLS_FLAGS+1
112 ;;
113 ;;
114EITHER_SHIFT EQU 80H ;; EXT_KB_FLAG : our own shift state
115EITHER_CTL EQU 40H ;; flags
116EITHER_ALT EQU 20H ;;
117SCAN_MATCH EQU 08H ;; set if scan code found in XLATT
118 ;; or SET_FLAG searches
119 ;;
120 ;;
121KB_FLAG_ID EQU 0 ;; Flag ID's as coded in IFF and ANDF
122KB_FLAG_1_ID EQU 1 ;; commands
123KB_FLAG_2_ID EQU 2 ;;
124KB_FLAG_3_ID EQU 3 ;;
125EXT_KB_FLAG_ID EQU 4 ;;
126NLS_FLAG_1_ID EQU 5 ;;
127NLS_FLAG_2_ID EQU 6 ;;
128 ;;
129COMMAND_BITS EQU 0F0H ;; Mask to isolate command code
130SUB_CMD_BITS EQU 0FH ;; mask to isolate sub command code
131NOT_TEST EQU 08H ;; NOT bit in IFF, ANDF
132COMMAND_SHIFT EQU 4 ;; shift amount for command code
133FLAG_ID_BITS EQU 07H ;; mask to isolate flag id in IFF, ANDF
134NUM_COMMANDS EQU 0CH ;; number of commands
135 ;;
136IFF_COMMAND EQU 00H ;;
137ANDF_COMMAND EQU 10H ;;
138ELSEF_COMMAND EQU 20H ;;
139ENDIFF_COMMAND EQU 30H ;;
140XLATT_COMMAND EQU 40H ;;
141OPTION_COMMAND EQU 50H ;;
142SET_FLAG_COMMAND EQU 60H ;;
143PUT_ERROR_COMMAND EQU 70H ;;
144IFKBD_COMMAND EQU 80H ;;
145GOTO_COMMAND EQU 90H ;;
146BEEP_COMMAND EQU 0A0H ;;
147RESET_NLS_COMMAND EQU 0B0H ;;
148CHECK_CORE_COMMAND EQU 0C0H ;;
149 ;;
150 ;;
151EXIT_INT_9_FLAG EQU 01H ;; Special forms of GOTO. These
152EXIT_STATE_LOGIC_FLAG EQU 02H ;; values are in the right nibble
153 ;; of the GOTO command.
154 ;;
155 ;; PROCESSING OPTIONS:
156EXIT_IF_FOUND EQU 80H ;; exit INT 9 if a translation
157 ;; match is found
158 ;;
159ANY_KB EQU 0FFFFH ;;
160JR_KB EQU 8000H ;; Keyboard types
161XT_KB EQU 4000H ;;
162AT_KB EQU 2000H ;;
163G_KB EQU 1000H ;;
164P_KB EQU 0800H ;;
165P12_KB EQU 0400H ;;
166 ;;
167;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
168;; Translate Table Sections. Both the Specific and Common
169;; Translate Sections are formatted as follows.
170;;
171;; The Specific Translate Sections are chained together using the
172;; XS_NEXT_SECT_PTR field (-1 if last section).
173;; Translate Sections contains multiple States.
174;; A State contains the translate tables for a single
175;; shift state (IE lower case, upper case ....)
176;; Each State may contain multiple translate tables.
177;;
178;; The Translate Section layout is defined using several STRUCs.
179;; These STRUCs are allocated in the Shared Data Area as follows:
180;;
181;; XLAT_SECT_STR ; header info for the section
182;; STATE_STR ; header for state #1
183;; XLAT_STR ; first translate tab for state #1
184;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR
185;; XLAT_STR ; second translate tab
186;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR
187;; ...
188;; STATE_STR ; header for state #2
189;; XLAT_STR
190;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR
191;; ...
192;; ...
193;;
194;; A State may contain a "Set_Flag" table instead of translate tables.
195;; These tables are used to set the NLS flags instead of generating
196;; ASCII codes (for example: to remember dead key states).
197;; There can be only on Set_Flag table per state.
198;; The Set_Flag table layout is defined in the SET_FLAG_STR STRUC.
199;;
200;; So some states will contain translate tables (to generate ASCII codes)
201;; and some states will contain a Set_Flag table (to record dead key
202;; status).
203;;
204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
205 ;;
206XLAT_SECT_STR STRUC ;;
207 ;;
208XS_NEXT_SECT_PTR DW ? ;; Pointer to next Specific Translate
209 ;; Section
210XS_CP_ID DW ? ;; code page id
211XS_FIRST_STATE DB ? ;;
212 ;;
213XLAT_SECT_STR ENDS ;;
214 ;;
215;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
216;; State structure.
217;; The last State is a null State containing only the
218;; XS_STATE_LEN field with a value of 0.
219;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
220 ;;
221STATE_STR STRUC ;;
222 ;;
223XS_STATE_LEN DW ? ;; length of state section
224XS_STATE_ID DB ? ;; State ID
225XS_KBD_TYPE DW ? ;; Keyboard Type
226XS_ERROR_CHAR DW ? ;; Buffer entry for error character
227XS_FIRST_TAB DB ? ;;
228 ;;
229STATE_STR ENDS ;;
230 ;;
231;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
232;; Translate Table structures.
233;; There may be many translate tables in a State. The last
234;; table is a null table containing only the XLAT_TAB_SIZE field with
235;; a value of 0.
236;; The xlate table can be in one of two forms:
237;; Type 1 = Table contains buffer entries only.
238;; Scan code is used as an index into xlat table
239;; Type 2 = Table contains pairs of SCAN/BUFFER_ENTRY.
240;; Table must be searched for matching scan.
241;; Type 1 is the default. Type 2 tables should be identified by setting
242;; the TYPE_2_TAB bit in XLAT_OPTIONS.
243;; Buffer entries default to 2-bytes per entry.
244;; Optionally the table may contain ASCII codes only
245;; (1-byte entries). This is specified by setting the ASCII_ONLY bit
246;; in XLAT_OPTIONS. 2-byte buffer entries are coded ASCII,SCAN.
247;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
248 ;;
249 ;; Translate options:
250ASCII_ONLY EQU 80H ;; Only ASCII codes listed - use
251 ;; incoming scan for buffer entry
252TYPE_2_TAB EQU 40H ;; search xlat table for matching scan
253ZERO_SCAN EQU 20H ;; set the scan half of the buffer
254 ;; entry to 0
255 ;;
256NULL_ASCII_CODE EQU -1 ;;
257 ;;
258DEFAULT_TAB_2_ENT_SZ EQU 3 ;;
259ASC_ONLY_TAB_2_ENT_SZ EQU 2 ;;
260 ;;
261 ;;
262XLAT_STR STRUC ;;
263 ;;
264XLAT_TAB_SIZE DW ? ;; Size in bytes of this table -
265 ;; includes this field, options etc.
266XLAT_OPTIONS DB ? ;; xlat options
267 ;; XLAT TABLE IS HERE
268XLAT_STR ENDS ;;
269 ;;
270XLAT_TYPE_1_STR STRUC ;; use scan code as index into table
271 DB TYPE XLAT_STR DUP(?) ;; filler
272XLAT_SCAN_LO DB ? ;; Scan code
273XLAT_SCAN_HI DB ? ;; range
274XLAT_1_BUF_ENTRY DB ? ;; The table itself
275XLAT_TYPE_1_STR ENDS ;;
276 ;;
277XLAT_TYPE_2_STR STRUC ;; search table for scan
278 DB TYPE XLAT_STR DUP(?) ;; filler
279XLAT_NUM DB ? ;; number of scans
280XLAT_SCAN DB ? ;; Scan code
281XLAT_2_BUF_ENTRY DB ? ;; The table itself
282XLAT_TYPE_2_STR ENDS ;;
283 ;;
284;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
285;; Set_Flag Tables.
286;; State Sections immediately following the LAST_ENTRYs.
287;; Dead key definitions. If the scan matches then
288;; set the bit in NLS_FLAGs indicated in DK_MASK
289;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
290 ;;
291SF_ENT_SZ EQU 3 ;; size of entry
292 ;;
293SET_FLAG_STR STRUC ;;
294 ;;
295SF_NUM DB 0 ;; Number of entries
296SF_SCAN_CODE DB 0 ;; scan code
297SF_FLAG_ID DB 0 ;; flag id
298SF_FLAG_MASK DB 0 ;; flag mask
299 ;;
300SET_FLAG_STR ENDS ;;
301 ;;
302 ;;
303;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
304.LIST