6 TITLE TYPAMAT
.SAL - TYPAMATIC RATE
AND DELAY CONTROL FOR MODE COMMAND
9 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
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.
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.
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.
39 ;³ ASSUMPTIONS: Input values are valid.
45 ;³ ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
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 ³
54 ;³ MOV BL,previous_typamatic_rate ;not specified so no change ³
56 ;³ IF delay <> 0 THEN ³
57 ;³ SUB BH,1 ;translate delay ³
59 ;³ MOV BH,previous_delay_rate ³
61 ;³ MOV AH,set_typamatic_rate_and_delay ;INT 16 set typamatic function ³
62 ;³ MOV AL,typamatic_function ;set typamatic subfunction ³
65 ;³ queue Function_not_supported ³
70 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
75 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
85 SET
MACRO REG
,VALUE
;SET REG TO VALUE. DON'T SPECIFY AX FOR REG
95 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
98 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
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
114 INCLUDE modequat
.inc ;definitions of machine types
115 include version
.inc ; defines version of DOS to be built
118 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
121 PRINTF_CODE
SEGMENT PUBLIC
122 ASSUME
DS:NOTHING
, CS:PRINTF_CODE
125 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
129 EXTRN MACHINE_TYPE
:BYTE ;MACHINE TYPE as determined by "modeleng"
130 ;EXTRN typamatic_rate_set_to:WORD
131 ;EXTRN chars_per_second:WORD
133 ;EXTRN no_previous_typamatic_rate:WORD
134 EXTRN Function_not_supported
:BYTE ;see modedefs.inc
135 ;EXTRN delay_set_to:WORD
137 ;EXTRN no_previous_delay_setting:WORD
138 ;EXTRN delay_set_to_one_half_second:WORD
141 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
144 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
147 thirty_two
DB 20H
;adjustment and work area for typamatic rate
150 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
153 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
156 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
162 ;*********************************************************************************************
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
176 ; MOV AH,resident_MODE
177 ; MOV AL,get_installed_state
180 ; .IF NE ;IF the code is not resident THEN
181 ; CALL modeload ;make it resident
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
188 ; DISPLAY typamatic_rate_set_to,BL
189 ; DISPLAY chars_per_second
192 ; MOV AH,resident_MODE
193 ; MOV AL,get_typamatic_rate ; MOV BL,previous_typamatic_rate ;not specified so no change
195 ; CMP BL,no_previous_setting
197 ; DISPLAY no_previous_typamatic_rate
198 ; DISPLAY typamatic_set_to_ten_chars_per_second
199 ; MOV BL,ten_chars_per_second
201 ; .ELSE ; less than zero:
202 ; MOV AH,resident_MODE
203 ; MOV AL,get_typamatic_rate ; return setting in BL
205 ; .IF <BL EQ no_previous_setting> THEN
206 ; DISPLAY no_previous_typamatic_rate
209 ; MOV BL,thirty_two ; translate to humanese
212 ; CMP BH,0 ;CASE delay OF
214 DEC BH ; SUB BH,1 ;translate delay
217 ; DISPLAY delay_set_to_?_second
221 ; MOV AH,resident_MODE
222 ; MOV AL,get_typamatic_delay ; MOV BH,previous_delay_rate
224 ; CMP BH,no_previous_setting
226 ; DISPLAY no_previous_delay_setting
227 ; DISPLAY delay_set_to_one_half_second
228 ; MOV BH,one_half_second
231 ; MOV AH,resident_MODE
232 ; MOV AL,get_typamatic_rate ; return setting in BH
234 ; .IF <BH EQ no_previous_setting> THEN
235 ; DISPLAY no_previous_delay_setting
240 ; MOV AH,resident_MODE
241 ; MOV AL,save_typamatic_rate
243 ; MOV AH,resident_MODE
244 ; MOV AL,save_typamatic_delay
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
251 DISPLAY Function_not_supported