Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!ucbvax!ucdavis!iris!chiang From: chiang@iris.ucdavis.edu (Tom Chiang) Newsgroups: comp.os.msdos.programmer Subject: TSR PROGRAMMING PROBLEM Summary: WHAT'S WRONG WITH THIS CODE? Message-ID: <8256@ucdavis.ucdavis.edu> Date: 29 Jan 91 10:37:20 GMT References: <1991Jan24.210122.5363@usenet@scion.CS.ORST.EDU> <1991Jan26.195955.12946@ugle.unit.no> <1991Jan26.220820.7855@uwasa.fi> Sender: usenet@ucdavis.ucdavis.edu Reply-To: chiang@iris.ucdavis.edu (Tom Chiang) Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 72 following below is asm code for a tsr with a few lines added by me... the tsr basically intercepts int 16 and changes the case of the letter Y whenever it it is typed....now, i added code to send the letter z to printer every time this int occured...but my system crashes from those new lines...any help would be appreciated PAGE 64,132 cseg segment assume cs:cseg,ds:cseg org 100H TSR proc far jmp initialize old_keyboard_io dd 0 new_keyboard_io proc far assume cs:cseg,ds:cseg sti cmp ah,0 je ki0 assume ds:nothing jmp old_keyboard_io ki0: pushf assume ds:nothing call old_keyboard_io cmp al,'y' jne ki1 mov al,'Y' jmp kidone ki1: cmp al,'Y' jne kidone mov al,'y' kidone: push dx ----- push ax | mov dl,'z' | mov ah,5H | ----- these are the instructions i added int 21H | pop ax | pop dx ------ iret new_keyboard_io endp initialize: assume cs:cseg,ds:cseg mov bx,cs mov ds,bx mov al,16H mov ah,35H int 21H mov si,offset old_keyboard_io mov [si],bx mov [si+2],es mov dx,offset new_keyboard_io mov al,16H mov ah,25H int 21H mov dx,offset initialize int 27H TSR endp cseg ends end TSR