This code works but for some reason it disables some doskey macros I have loaded.
Does anyone know why that is happening ?


; xit.asm  Andrew Kennedy  9/29/03 
;                                 
;          TSR which exits from DOS by pressing the F12 key
;          (injects EXIT into keyboard buffer)
;          Put this in autoexec.bat or into the DOS prompt PIF
;         

code            segment
                assume  cs:code
                org    100h

begin:

jmp    start

old9            label  dword
old9lo          dw      ?
old9hi          dw      ?

new9            proc    far
push  ax
in    al,60h
cmp    al,58h  ; has F12 key been pressed
jne    new9out
                ; inject 'exit' into keyboard buffer
mov    cl,'e'  ; Character must be in CL
mov    ah,5    ; Service = Inject Char into kbdbuf
int    16h
mov    cl,'x' 
mov    ah,5   
int    16h
mov    cl,'i' 
mov    ah,5   
int    16h
mov    cl,'t' 
mov    ah,5   
int    16h
mov    cl,0dh  ; inject an "enter" key
mov    ah,5
int    16h

new9out:
pop    ax
jmp    old9
new9            endp

start:
mov    bx,2ch
mov    es,    ; segment of block to free
mov    ah,49h      ; Free memory
int    21h

mov    ax,3509h    ; Get interrupt vector
int    21h          ;
mov    old9lo,bx
mov    old9hi,es

mov    ax,2509h      ; set interrupt vector
mov    dx,offset new9
int    21h

mov    ax,3100h        ; Go TSR
mov    dx,offset start
add    dx,15
shr    dx,4
int    21h

code            ends
end    begin
Posted on 2006-04-07 10:28:10 by skywalker
skywalker,
    What is this post doing the The Heap? Shouldn't it be in the Dos & Bios section instead?  Ratch
Posted on 2006-04-07 10:42:14 by Ratch

skywalker,
    What is this post doing the The Heap? Shouldn't it be in the Dos & Bios section instead?  Ratch


Didn't know there was that section.

Posted on 2006-04-07 15:06:52 by skywalker