summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/KEYB/KEYBSHAR.INC
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/KEYB/KEYBSHAR.INC
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/CMD/KEYB/KEYBSHAR.INC')
-rw-r--r--v4.0/src/CMD/KEYB/KEYBSHAR.INC307
1 files changed, 307 insertions, 0 deletions
diff --git a/v4.0/src/CMD/KEYB/KEYBSHAR.INC b/v4.0/src/CMD/KEYB/KEYBSHAR.INC
new file mode 100644
index 0000000..75bbc13
--- /dev/null
+++ b/v4.0/src/CMD/KEYB/KEYBSHAR.INC
@@ -0,0 +1,307 @@
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 PALACE
52PC_386 EQU 0200H ;; code for WRANGLER
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
69TIMING_FACTOR DW 1 ;; Scale factor for INT 9 timing loops
70 ;; PC_AT = 1
71 DB 2 DUP(0) ;; reserved
72 ;;
73 ;; Table copy begins here:
74ACTIVE_LANGUAGE DB 'US' ;; language code
75INVOKED_CP_TABLE DW 437 ;; ptr to table for invoked code page
76INVOKED_KBD_ID DW 0 ;; WGR invoked keyboard id. ;AN000
77ACTIVE_XLAT_PTR DW -1 ;; ptr to active Specific Translate Sect
78FIRST_XLAT_PTR DW -1 ;; ptr to first Specific Translate Sect
79RESIDENT_END DW 0ffffh ;; offset of last byte in resident mem
80LOGIC_PTR DW -1 ;; ptr to State Logic
81COMMON_XLAT_PTR DW -1 ;; ptr to Common Translate Section
82SPECIAL_FEATURES DW ? ;; special Features
83TABLE_OVERFLOW DB 0 ;; overflow flag for table rebuild
84HOT_KEY_ON_SCAN DB ? ;; scan codes to use with ALT+CTRL
85HOT_KEY_OFF_SCAN DB ? ;; to turn hot key on and off
86 DB 4 DUP(0) ;; reserved
87TABLE_AREA DB ? ;; tables loaded here:
88 ;; State Logic
89 ;; Common Translate Section
90 ;; Specific Translate Sections for
91 ;; each code page
92SHARED_DATA_STR ENDS ;;
93 ;;
94 ;;
95 ;;
96;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
97;; State Logic equates.
98;; Contains equates for our NLS Flags and for the State Logic
99;; commands.
100;; State Logic command macros are defined in KEYBMAC.INC
101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
102 ;;
103STATE_LOGIC_STR STRUC ;;
104 ;;
105SL_LOGIC_LEN DW ? ;; length of state logic
106SL_SPECIAL_FEATURES DW ? ;;
107SL_LOGIC_CMDS DB 0 ;; state logic commands begin here
108 ;;
109STATE_LOGIC_STR ENDS ;;
110 ;;
111 ;;
112NUM_BIOS_FLAGS EQU 4 ;;
113NUM_NLS_FLAGS EQU 2 ;; '+1' below is the EXT_KB_FLAG
114NUM_FLAGS EQU NUM_BIOS_FLAGS+NUM_NLS_FLAGS+1
115 ;;
116 ;;
117EITHER_SHIFT EQU 80H ;; EXT_KB_FLAG : our own shift state
118EITHER_CTL EQU 40H ;; flags
119EITHER_ALT EQU 20H ;;
120SCAN_MATCH EQU 08H ;; set if scan code found in XLATT
121 ;; or SET_FLAG searches
122 ;;
123 ;;
124KB_FLAG_ID EQU 0 ;; Flag ID's as coded in IFF and ANDF
125KB_FLAG_1_ID EQU 1 ;; commands
126KB_FLAG_2_ID EQU 2 ;;
127KB_FLAG_3_ID EQU 3 ;;
128EXT_KB_FLAG_ID EQU 4 ;;
129NLS_FLAG_1_ID EQU 5 ;;
130NLS_FLAG_2_ID EQU 6 ;;
131 ;;
132COMMAND_BITS EQU 0F0H ;; Mask to isolate command code
133SUB_CMD_BITS EQU 0FH ;; mask to isolate sub command code
134NOT_TEST EQU 08H ;; NOT bit in IFF, ANDF
135COMMAND_SHIFT EQU 4 ;; shift amount for command code
136FLAG_ID_BITS EQU 07H ;; mask to isolate flag id in IFF, ANDF
137NUM_COMMANDS EQU 0CH ;; number of commands
138 ;;
139IFF_COMMAND EQU 00H ;;
140ANDF_COMMAND EQU 10H ;;
141ELSEF_COMMAND EQU 20H ;;
142ENDIFF_COMMAND EQU 30H ;;
143XLATT_COMMAND EQU 40H ;;
144OPTION_COMMAND EQU 50H ;;
145SET_FLAG_COMMAND EQU 60H ;;
146PUT_ERROR_COMMAND EQU 70H ;;
147IFKBD_COMMAND EQU 80H ;;
148GOTO_COMMAND EQU 90H ;;
149BEEP_COMMAND EQU 0A0H ;;
150RESET_NLS_COMMAND EQU 0B0H ;;
151CHECK_CORE_COMMAND EQU 0C0H ;;
152 ;;
153 ;;
154EXIT_INT_9_FLAG EQU 01H ;; Special forms of GOTO. These
155EXIT_STATE_LOGIC_FLAG EQU 02H ;; values are in the right nibble
156 ;; of the GOTO command.
157 ;;
158 ;; PROCESSING OPTIONS:
159EXIT_IF_FOUND EQU 80H ;; exit INT 9 if a translation
160 ;; match is found
161 ;;
162ANY_KB EQU 0FFFFH ;;
163JR_KB EQU 8000H ;; Keyboard types
164XT_KB EQU 4000H ;;
165AT_KB EQU 2000H ;;
166G_KB EQU 1000H ;;
167P_KB EQU 0800H ;;
168P12_KB EQU 0400H ;;
169 ;;
170;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
171;; Translate Table Sections. Both the Specific and Common
172;; Translate Sections are formatted as follows.
173;;
174;; The Specific Translate Sections are chained together using the
175;; XS_NEXT_SECT_PTR field (-1 if last section).
176;; Translate Sections contains multiple States.
177;; A State contains the translate tables for a single
178;; shift state (IE lower case, upper case ....)
179;; Each State may contain multiple translate tables.
180;;
181;; The Translate Section layout is defined using several STRUCs.
182;; These STRUCs are allocated in the Shared Data Area as follows:
183;;
184;; XLAT_SECT_STR ; header info for the section
185;; STATE_STR ; header for state #1
186;; XLAT_STR ; first translate tab for state #1
187;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR
188;; XLAT_STR ; second translate tab
189;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR
190;; ...
191;; STATE_STR ; header for state #2
192;; XLAT_STR
193;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR
194;; ...
195;; ...
196;;
197;; A State may contain a "Set_Flag" table instead of translate tables.
198;; These tables are used to set the NLS flags instead of generating
199;; ASCII codes (for example: to remember dead key states).
200;; There can be only on Set_Flag table per state.
201;; The Set_Flag table layout is defined in the SET_FLAG_STR STRUC.
202;;
203;; So some states will contain translate tables (to generate ASCII codes)
204;; and some states will contain a Set_Flag table (to record dead key
205;; status).
206;;
207;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
208 ;;
209XLAT_SECT_STR STRUC ;;
210 ;;
211XS_NEXT_SECT_PTR DW ? ;; Pointer to next Specific Translate
212 ;; Section
213XS_CP_ID DW ? ;; code page id
214XS_FIRST_STATE DB ? ;;
215 ;;
216XLAT_SECT_STR ENDS ;;
217 ;;
218;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
219;; State structure.
220;; The last State is a null State containing only the
221;; XS_STATE_LEN field with a value of 0.
222;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
223 ;;
224STATE_STR STRUC ;;
225 ;;
226XS_STATE_LEN DW ? ;; length of state section
227XS_STATE_ID DB ? ;; State ID
228XS_KBD_TYPE DW ? ;; Keyboard Type
229XS_ERROR_CHAR DW ? ;; Buffer entry for error character
230XS_FIRST_TAB DB ? ;;
231 ;;
232STATE_STR ENDS ;;
233 ;;
234;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
235;; Translate Table structures.
236;; There may be many translate tables in a State. The last
237;; table is a null table containing only the XLAT_TAB_SIZE field with
238;; a value of 0.
239;; The xlate table can be in one of two forms:
240;; Type 1 = Table contains buffer entries only.
241;; Scan code is used as an index into xlat table
242;; Type 2 = Table contains pairs of SCAN/BUFFER_ENTRY.
243;; Table must be searched for matching scan.
244;; Type 1 is the default. Type 2 tables should be identified by setting
245;; the TYPE_2_TAB bit in XLAT_OPTIONS.
246;; Buffer entries default to 2-bytes per entry.
247;; Optionally the table may contain ASCII codes only
248;; (1-byte entries). This is specified by setting the ASCII_ONLY bit
249;; in XLAT_OPTIONS. 2-byte buffer entries are coded ASCII,SCAN.
250;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
251 ;;
252 ;; Translate options:
253ASCII_ONLY EQU 80H ;; Only ASCII codes listed - use
254 ;; incoming scan for buffer entry
255TYPE_2_TAB EQU 40H ;; search xlat table for matching scan
256ZERO_SCAN EQU 20H ;; set the scan half of the buffer
257 ;; entry to 0
258 ;;
259NULL_ASCII_CODE EQU -1 ;;
260 ;;
261DEFAULT_TAB_2_ENT_SZ EQU 3 ;;
262ASC_ONLY_TAB_2_ENT_SZ EQU 2 ;;
263 ;;
264 ;;
265XLAT_STR STRUC ;;
266 ;;
267XLAT_TAB_SIZE DW ? ;; Size in bytes of this table -
268 ;; includes this field, options etc.
269XLAT_OPTIONS DB ? ;; xlat options
270 ;; XLAT TABLE IS HERE
271XLAT_STR ENDS ;;
272 ;;
273XLAT_TYPE_1_STR STRUC ;; use scan code as index into table
274 DB TYPE XLAT_STR DUP(?) ;; filler
275XLAT_SCAN_LO DB ? ;; Scan code
276XLAT_SCAN_HI DB ? ;; range
277XLAT_1_BUF_ENTRY DB ? ;; The table itself
278XLAT_TYPE_1_STR ENDS ;;
279 ;;
280XLAT_TYPE_2_STR STRUC ;; search table for scan
281 DB TYPE XLAT_STR DUP(?) ;; filler
282XLAT_NUM DB ? ;; number of scans
283XLAT_SCAN DB ? ;; Scan code
284XLAT_2_BUF_ENTRY DB ? ;; The table itself
285XLAT_TYPE_2_STR ENDS ;;
286 ;;
287;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
288;; Set_Flag Tables.
289;; State Sections immediately following the LAST_ENTRYs.
290;; Dead key definitions. If the scan matches then
291;; set the bit in NLS_FLAGs indicated in DK_MASK
292;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
293 ;;
294SF_ENT_SZ EQU 3 ;; size of entry
295 ;;
296SET_FLAG_STR STRUC ;;
297 ;;
298SF_NUM DB 0 ;; Number of entries
299SF_SCAN_CODE DB 0 ;; scan code
300SF_FLAG_ID DB 0 ;; flag id
301SF_FLAG_MASK DB 0 ;; flag mask
302 ;;
303SET_FLAG_STR ENDS ;;
304 ;;
305 ;;
306;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
307.LIST