home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
sysutl
/
hot_36.arc
/
HOT36.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-12-27
|
3KB
|
161 lines
;HOT.ASM
;From SIMTEL20's PD:<MSDOS.SYSUTL>
;Original Toad Hall Tweak, 5 Sep 88
; v3.6, 27 Dec 88
; - Tightening code a little.
; - Moved Page 0 save buffer to "dynamic" code space at program end.
; - Getting Int 9 vector from our save buffer rather than the Svc 35h.
Page0 SEGMENT AT 0
org 417H
kbdflag db ? ;keyboard state flag
Page0 ENDS
CSeg SEGMENT WORD PUBLIC 'PROG'
ASSUME CS:CSeg, DS:CSeg
org 100H
Hot proc near ;TH
jmp Go_Strt
;icopy db 400h dup (?)
;oldkey dw 0,0
blksiz dw 0
blkadr dw 0
Hot endp ;TH
;;;;;
Go_Key proc far ;TH
ASSUME DS:Nothing,ES:Nothing
pop DS
pop ax
; jmp CS:dword ptr oldkey
jmp CS:dword ptr int9 ;jump to old Int 9 vector v1.2
Go_Key endp ;TH
My_Key proc far ;TH
push ax
push DS
xor ax,ax ;Page 0
mov DS,ax
ASSUME DS:Page0,ES:Nothing
mov al,kbdflag ;DOS keyboard state flag
and al,0ch
cmp al,0ch
jne Go_Key ;not pressed, continue to old int
in al,60h ;read the kbd
and al,7fh ;mask for possible values
cmp al,82 ;INS key?
jne Go_Key ;nope, go on to old interrupt
; yes, eat the key
in al,61h ;read kbd
mov ah,al ;save char in AH
or al,80h ;reset kbd interrupt
out 61h,al
xchg ah,al ;kbd byte
out 61h,al ;back to kbd
mov al,20h ; non-specific EOI for 8259
out 20h,al
; do the HOT-BOOT
mov ax,CS
mov DS,ax
ASSUME DS:CSeg
;Setting up the block after our resident code as the "next free block"
;for DOS.
mov ax,blkadr
mov ES,ax
ASSUME ES:Nothing
xor di,di ;segment base TH
cld ;insure fwd
mov al,5ah
stosb
xor ax,ax ;TH
stosw
mov ax,blksiz
stosw
xor ax,ax
mov ES,ax ;ES=page 0
mov ax,CS
mov DS,ax
ASSUME DS:CSeg,ES:Page0
mov si,offset icopy ;the base data we copied on install
xor di,di ;to Page 0 base v1.1
mov cx,200h ;200H words
rep movsw ;ints are off during this 'rep' move
mov bx,CS
mov ah,50h ; set psp
int 21h
mov ax,4c00h ;terminate process
int 21h
My_Key endp
Go_Strt proc near
mov bx,DS ;save DS a sec v1.2
xor ax,ax
mov DS,ax
ASSUME DS:Page0,ES:CSeg
cld ;insure fwd
xor si,si ;from Page 0 base
mov di,offset icopy ;into our buffer
mov cx,200h ;copy 200H words
rep movsw
mov DS,bx ;restore DS v1.2
ASSUME DS:CSeg
;; mov ax,3509h ; get int 9
;; int 21h
; les ax,dword ptr int9 ;get Int 9 vector from our buffer v1.2
; mov oldkey,ax ;save old Int 9 vector
; mov oldkey+2,ES
mov ax,2509h ;Set Int 9 vector
mov dx,offset My_Key ;to our service
int 21h
mov ax,CS
mov ES,ax
ASSUME DS:CSeg
mov bx,offset endpgm ;code end
add bx,15 ;a little space
mov cl,4 ;*4 for paras
shr bx,cl
mov dx,bx ;into DX
mov ax,CS
add ax,dx
mov blkadr,ax ;next segment block
mov ah,4ah ;modify allocated blocks
int 21h
mov bx,0ffffh ;how much is there?
mov ah,48h ;allocate memory function
int 21h
mov blksiz,bx ;returned in BX, save
mov ax,3100h ;go TSR
int 21h
Go_Strt endp ;TH
even
PC = $
icopy = PC ;buffer to save Page 0
int9 = PC + (9 * 4) ;start of saved Int 9 vector
PC = PC + 400H ;400 bytes long
endpgm = PC
CSeg ends
end Hot