From 2d04cacc5322951f187bb17e017c12920ac8ebe2 Mon Sep 17 00:00:00 2001 From: Mark Zbikowski Date: Thu, 25 Apr 2024 21:24:10 +0100 Subject: MZ is back! --- v4.0/src/CMD/MODE/TYPAMAT.ASM | 263 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 v4.0/src/CMD/MODE/TYPAMAT.ASM (limited to 'v4.0/src/CMD/MODE/TYPAMAT.ASM') diff --git a/v4.0/src/CMD/MODE/TYPAMAT.ASM b/v4.0/src/CMD/MODE/TYPAMAT.ASM new file mode 100644 index 0000000..a2447ae --- /dev/null +++ b/v4.0/src/CMD/MODE/TYPAMAT.ASM @@ -0,0 +1,263 @@ +.XLIST +INCLUDE STRUC.INC +.LIST +.SALL + PAGE ,132 ; + TITLE TYPAMAT.SAL - TYPAMATIC RATE AND DELAY CONTROL FOR MODE COMMAND + + +;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +;³ +;³ SET_TYPAMATIC +;³ ------------- +;³ Translate the input parameters into BIOS digestable values and make the +;³ required calls. Typamatic support in BIOS exists only in machines with +;³ BIOS dated 11/15/85 or later, XT286 and all PS/2 products. +;³ +;³ +;³; INPUT: A binary value from 1 to 32 indicating the typamatic rate +;³ desired and a binary value from 1 to 4 indicating the delay. +;³ Status is not supported on machines known today. +;³ The translation of the typamatic value to BIOS +;³ input is 32 - r where 'r' is the input value. The translation +;³ from 'd' the input delay value to the BIOS is d - 1. 'r' +;³ is passed in BL, 'd' is passed in BH. +;³ +;³ RETURN: none +;³ +;³ +;³ MESSAGES: none +;³ +;³ +;³ +;³ REGISTER +;³ USAGE AND +;³ COMVENTIONS: BX is used to pass parameters to BIOS +;³ The names used to represent the valid machines are: AT3, XT286, +;³ PS2Model30, PS2Model50, PS2Model60 and PS2Model80. +;³ +;³ ASSUMPTIONS: Input values are valid. +;³ +;³ +;³ SIDE EFFECT: +;³ +;³ +;³ ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù +;³ +;³ BEGIN +;³ +;³ IF (machine_type>AT) OR ((machine_type=AT) AND (BIOS_date >= 11/15/85)) OR +;³ (machine_type=XT286) THEN +;³ IF typamatic_rate <> 0 THEN ³ +;³ MOV BL,32-BL ;translate typamatic rate ³ +;³ ELSE ³ +;³ MOV BL,previous_typamatic_rate ;not specified so no change ³ +;³ ENDIF ³ +;³ IF delay <> 0 THEN ³ +;³ SUB BH,1 ;translate delay ³ +;³ ELSE ³ +;³ MOV BH,previous_delay_rate ³ +;³ ENDIF ³ +;³ MOV AH,set_typamatic_rate_and_delay ;INT 16 set typamatic function ³ +;³ MOV AL,typamatic_function ;set typamatic subfunction ³ +;³ INT 16H ³ +;³ ELSE ³ +;³ queue Function_not_supported ³ +;³ ENDIF ³ +;³ ³ +;³ END ³ +;³ +;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ + + + + +;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» +;º º + + + +DISPLAY MACRO MESSAGE + MOV DX,OFFSET MESSAGE + CALL PRINTF +ENDM + +SET MACRO REG,VALUE ;SET REG TO VALUE. DON'T SPECIFY AX FOR REG + + PUSH AX + MOV AX,VALUE + MOV REG,AX + POP AX + +ENDM + +;º º +;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ + + +;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» +;º º + +get_installed_state EQU 0 ;function of MODE INT 2FH handler +get_typamatic_delay EQU 04 ;function of MODE INT 2FH handler +get_typamatic_rate EQU 03 ;function of MODE INT 2FH handler +installed EQU 0FFH ;return from MODE INT 2FH handler +no_previous_setting EQU 0FFH ;return from MODE INT 2FH handler get setting call +one_half_second EQU 01 ;value for BIOS INT 16H +resident_MODE EQU 0AFH ;INT 2F multiplex number for resident part of MODE +save_typamatic_delay EQU 02 ;function of MODE INT 2FH handler +save_typamatic_rate EQU 01 ;function of MODE INT 2FH handler +set_typamatic_rate_and_delay EQU 3 +typamatic_function EQU 5 +ten_chars_per_second EQU 0CH ;value for BIOS INT 16H + +INCLUDE modequat.inc ;definitions of machine types +include version.inc ; defines version of DOS to be built + +;º º +;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ + + +PRINTF_CODE SEGMENT PUBLIC + ASSUME DS:NOTHING, CS:PRINTF_CODE + + +;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» +;º º + +EXTRN PRINTF:NEAR +EXTRN MACHINE_TYPE:BYTE ;MACHINE TYPE as determined by "modeleng" +;EXTRN typamatic_rate_set_to:WORD +;EXTRN chars_per_second:WORD +EXTRN noerror:BYTE +;EXTRN no_previous_typamatic_rate:WORD +EXTRN Function_not_supported:BYTE ;see modedefs.inc +;EXTRN delay_set_to:WORD +;EXTRN second:WORD +;EXTRN no_previous_delay_setting:WORD +;EXTRN delay_set_to_one_half_second:WORD + +;º º +;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ + + +;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» +;º º + +thirty_two DB 20H ;adjustment and work area for typamatic rate + +;º º +;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ + + +;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» +;º º +;º º +;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ + + + + +PAGE +;********************************************************************************************* + +TYPAMAT PROC NEAR +PUBLIC TYPAMAT + +if IBMCOPYRIGHT +.IF OR +.IF OR +;.IF OR +.IF OR +.IF OR +.IF OR +.IF THEN +endif +; MOV AH,resident_MODE +; MOV AL,get_installed_state +; INT 2FH +; CMP AL,installed +; .IF NE ;IF the code is not resident THEN +; CALL modeload ;make it resident +; .ENDIF ;ENDIF +; CMP BL,0 ;CASE typamatic_rate OF +; .IF GT greater than zero: + SUB thirty_two,BL ; MOV BL,32-BL ;translate typamatic rate + MOV BL,thirty_two + +; DISPLAY typamatic_rate_set_to,BL +; DISPLAY chars_per_second + +; .ELSEIF EQ ; zero: +; MOV AH,resident_MODE +; MOV AL,get_typamatic_rate ; MOV BL,previous_typamatic_rate ;not specified so no change +; INT 2FH +; CMP BL,no_previous_setting +; .IF E +; DISPLAY no_previous_typamatic_rate +; DISPLAY typamatic_set_to_ten_chars_per_second +; MOV BL,ten_chars_per_second +; .ENDIF +; .ELSE ; less than zero: +; MOV AH,resident_MODE +; MOV AL,get_typamatic_rate ; return setting in BL +; INT 2FH +; .IF THEN +; DISPLAY no_previous_typamatic_rate +; .ELSE +; SUB thirty_two,BL +; MOV BL,thirty_two ; translate to humanese +; .ENDIF +; .ENDIF ;ENDCASE +; CMP BH,0 ;CASE delay OF +; .IF GT >zero: + DEC BH ; SUB BH,1 ;translate delay + + +; DISPLAY delay_set_to_?_second + + +; .ELSEIF EQ ; zero: +; MOV AH,resident_MODE +; MOV AL,get_typamatic_delay ; MOV BH,previous_delay_rate +; INT 2FH +; CMP BH,no_previous_setting +; .IF E +; DISPLAY no_previous_delay_setting +; DISPLAY delay_set_to_one_half_second +; MOV BH,one_half_second +; .ENDIF +; .ELSE ; THEN +; DISPLAY no_previous_delay_setting +; .ELSE +; INC BH +; .ENDIF +; .ENDIF ;ENDCASE +; MOV AH,resident_MODE +; MOV AL,save_typamatic_rate +; INT 2FH +; MOV AH,resident_MODE +; MOV AL,save_typamatic_delay +; INT 2FH + MOV AH,set_typamatic_rate_and_delay ;MOV AH,set_typamatic_rate_and_delay ;INT 16 set typamatic function + MOV AL,typamatic_function ;MOV AL,typamatic_function ;set typamatic subfunction + INT 16H ;INT 16H +if IBMCOPYRIGHT +.ELSE + DISPLAY Function_not_supported + MOV noerror,false +.ENDIF +endif + +RET + +TYPAMAT ENDP + + +PRINTF_CODE ENDS + END + \ No newline at end of file -- cgit v1.2.3