]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/MODE/TYPAMAT.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / CMD / MODE / TYPAMAT.ASM
1 .XLIST
2 INCLUDE STRUC.INC
3 .LIST
4 .SALL
5 PAGE ,132 ;\ f
6 TITLE TYPAMAT.SAL - TYPAMATIC RATE AND DELAY CONTROL FOR MODE COMMAND
7
8
9 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
10
11 ;³ SET_TYPAMATIC
12 ;³ -------------
13 ;³ Translate the input parameters into BIOS digestable values and make the
14 ;³ required calls. Typamatic support in BIOS exists only in machines with
15 ;³ BIOS dated 11/15/85 or later, XT286 and all PS/2 products.
16
17
18 ;³; INPUT: A binary value from 1 to 32 indicating the typamatic rate
19 ;³ desired and a binary value from 1 to 4 indicating the delay.
20 ;³ Status is not supported on machines known today.
21 ;³ The translation of the typamatic value to BIOS
22 ;³ input is 32 - r where 'r' is the input value. The translation
23 ;³ from 'd' the input delay value to the BIOS is d - 1. 'r'
24 ;³ is passed in BL, 'd' is passed in BH.
25
26 ;³ RETURN: none
27
28
29 ;³ MESSAGES: none
30
31
32
33 ;³ REGISTER
34 ;³ USAGE AND
35 ;³ COMVENTIONS: BX is used to pass parameters to BIOS
36 ;³ The names used to represent the valid machines are: AT3, XT286,
37 ;³ PS2Model30, PS2Model50, PS2Model60 and PS2Model80.
38
39 ;³ ASSUMPTIONS: Input values are valid.
40
41
42 ;³ SIDE EFFECT:
43
44
45 ;³ ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
46
47 ;³ BEGIN
48
49 ;³ IF (machine_type>AT) OR ((machine_type=AT) AND (BIOS_date >= 11/15/85)) OR
50 ;³ (machine_type=XT286) THEN
51 ;³ IF typamatic_rate <> 0 THEN ³
52 ;³ MOV BL,32-BL ;translate typamatic rate ³
53 ;³ ELSE ³
54 ;³ MOV BL,previous_typamatic_rate ;not specified so no change ³
55 ;³ ENDIF ³
56 ;³ IF delay <> 0 THEN ³
57 ;³ SUB BH,1 ;translate delay ³
58 ;³ ELSE ³
59 ;³ MOV BH,previous_delay_rate ³
60 ;³ ENDIF ³
61 ;³ MOV AH,set_typamatic_rate_and_delay ;INT 16 set typamatic function ³
62 ;³ MOV AL,typamatic_function ;set typamatic subfunction ³
63 ;³ INT 16H ³
64 ;³ ELSE ³
65 ;³ queue Function_not_supported ³
66 ;³ ENDIF ³
67 ;³ ³
68 ;³ END ³
69
70 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
71
72
73
74
75 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
76 ;º º
77
78
79
80 DISPLAY MACRO MESSAGE
81 MOV DX,OFFSET MESSAGE
82 CALL PRINTF
83 ENDM
84
85 SET MACRO REG,VALUE ;SET REG TO VALUE. DON'T SPECIFY AX FOR REG
86
87 PUSH AX
88 MOV AX,VALUE
89 MOV REG,AX
90 POP AX
91
92 ENDM
93
94 ;º º
95 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
96
97
98 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
99 ;º º
100
101 get_installed_state EQU 0 ;function of MODE INT 2FH handler
102 get_typamatic_delay EQU 04 ;function of MODE INT 2FH handler
103 get_typamatic_rate EQU 03 ;function of MODE INT 2FH handler
104 installed EQU 0FFH ;return from MODE INT 2FH handler
105 no_previous_setting EQU 0FFH ;return from MODE INT 2FH handler get setting call
106 one_half_second EQU 01 ;value for BIOS INT 16H
107 resident_MODE EQU 0AFH ;INT 2F multiplex number for resident part of MODE
108 save_typamatic_delay EQU 02 ;function of MODE INT 2FH handler
109 save_typamatic_rate EQU 01 ;function of MODE INT 2FH handler
110 set_typamatic_rate_and_delay EQU 3
111 typamatic_function EQU 5
112 ten_chars_per_second EQU 0CH ;value for BIOS INT 16H
113
114 INCLUDE modequat.inc ;definitions of machine types
115 include version.inc ; defines version of DOS to be built
116
117 ;º º
118 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
119
120
121 PRINTF_CODE SEGMENT PUBLIC
122 ASSUME DS:NOTHING, CS:PRINTF_CODE
123
124
125 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
126 ;º º
127
128 EXTRN PRINTF:NEAR
129 EXTRN MACHINE_TYPE:BYTE ;MACHINE TYPE as determined by "modeleng"
130 ;EXTRN typamatic_rate_set_to:WORD
131 ;EXTRN chars_per_second:WORD
132 EXTRN noerror:BYTE
133 ;EXTRN no_previous_typamatic_rate:WORD
134 EXTRN Function_not_supported:BYTE ;see modedefs.inc
135 ;EXTRN delay_set_to:WORD
136 ;EXTRN second:WORD
137 ;EXTRN no_previous_delay_setting:WORD
138 ;EXTRN delay_set_to_one_half_second:WORD
139
140 ;º º
141 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
142
143
144 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
145 ;º º
146
147 thirty_two DB 20H ;adjustment and work area for typamatic rate
148
149 ;º º
150 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
151
152
153 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
154 ;º º
155 ;º º
156 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
157
158
159
160
161 PAGE
162 ;*********************************************************************************************
163
164 TYPAMAT PROC NEAR
165 PUBLIC TYPAMAT
166
167 if IBMCOPYRIGHT
168 .IF <machine_type EQ AT4> OR
169 .IF <machine_type EQ XT286> OR
170 ;.IF <machine_type EQ AT> OR
171 .IF <machine_type EQ PS2Model30> OR
172 .IF <machine_type EQ PS2Model50> OR
173 .IF <machine_type EQ PS2Model60> OR
174 .IF <machine_type EQ PS2Model80> THEN
175 endif
176 ; MOV AH,resident_MODE
177 ; MOV AL,get_installed_state
178 ; INT 2FH
179 ; CMP AL,installed
180 ; .IF NE ;IF the code is not resident THEN
181 ; CALL modeload ;make it resident
182 ; .ENDIF ;ENDIF
183 ; CMP BL,0 ;CASE typamatic_rate OF
184 ; .IF GT greater than zero:
185 SUB thirty_two,BL ; MOV BL,32-BL ;translate typamatic rate
186 MOV BL,thirty_two
187
188 ; DISPLAY typamatic_rate_set_to,BL
189 ; DISPLAY chars_per_second
190
191 ; .ELSEIF EQ ; zero:
192 ; MOV AH,resident_MODE
193 ; MOV AL,get_typamatic_rate ; MOV BL,previous_typamatic_rate ;not specified so no change
194 ; INT 2FH
195 ; CMP BL,no_previous_setting
196 ; .IF E
197 ; DISPLAY no_previous_typamatic_rate
198 ; DISPLAY typamatic_set_to_ten_chars_per_second
199 ; MOV BL,ten_chars_per_second
200 ; .ENDIF
201 ; .ELSE ; less than zero:
202 ; MOV AH,resident_MODE
203 ; MOV AL,get_typamatic_rate ; return setting in BL
204 ; INT 2FH
205 ; .IF <BL EQ no_previous_setting> THEN
206 ; DISPLAY no_previous_typamatic_rate
207 ; .ELSE
208 ; SUB thirty_two,BL
209 ; MOV BL,thirty_two ; translate to humanese
210 ; .ENDIF
211 ; .ENDIF ;ENDCASE
212 ; CMP BH,0 ;CASE delay OF
213 ; .IF GT >zero:
214 DEC BH ; SUB BH,1 ;translate delay
215
216
217 ; DISPLAY delay_set_to_?_second
218
219
220 ; .ELSEIF EQ ; zero:
221 ; MOV AH,resident_MODE
222 ; MOV AL,get_typamatic_delay ; MOV BH,previous_delay_rate
223 ; INT 2FH
224 ; CMP BH,no_previous_setting
225 ; .IF E
226 ; DISPLAY no_previous_delay_setting
227 ; DISPLAY delay_set_to_one_half_second
228 ; MOV BH,one_half_second
229 ; .ENDIF
230 ; .ELSE ; <zero:
231 ; MOV AH,resident_MODE
232 ; MOV AL,get_typamatic_rate ; return setting in BH
233 ; INT 2FH
234 ; .IF <BH EQ no_previous_setting> THEN
235 ; DISPLAY no_previous_delay_setting
236 ; .ELSE
237 ; INC BH
238 ; .ENDIF
239 ; .ENDIF ;ENDCASE
240 ; MOV AH,resident_MODE
241 ; MOV AL,save_typamatic_rate
242 ; INT 2FH
243 ; MOV AH,resident_MODE
244 ; MOV AL,save_typamatic_delay
245 ; INT 2FH
246 MOV AH,set_typamatic_rate_and_delay ;MOV AH,set_typamatic_rate_and_delay ;INT 16 set typamatic function
247 MOV AL,typamatic_function ;MOV AL,typamatic_function ;set typamatic subfunction
248 INT 16H ;INT 16H
249 if IBMCOPYRIGHT
250 .ELSE
251 DISPLAY Function_not_supported
252 MOV noerror,false
253 .ENDIF
254 endif
255
256 RET
257
258 TYPAMAT ENDP
259
260
261 PRINTF_CODE ENDS
262 END
263 \1a