946 Subj : Some Source Code To : All From : Robert Todd Date : Thu Dec 07 2000 01:52 am FORUM: (104) comp.lang.pascal.borland MSG#: 14129 FROM: NAT.MEAD@NTLWORLD.COM DATE: 22 Nov 2000, 12:10p TO: ALL SUBJECT: source ascii-tsr { source - asciitsr.pas Example of howto create a interrupt driven tsr. displays a ascii table. Just one question though... how the hell do you unload a tsr? ofcourse you can set the int back to previous, but how about unloading the tsr itself so it dont take any mem? and what the f**k does fcuk stand for?? Code^Bandit. to call this tsr, use this in a seperate program: procedure callmycrap; begin asm mov ax, 0001; int $FE end; end. that'll call the tsr. } {$M 4000,0,1000} {doesnt use any heap but who cares} uses dos; type string11 = string[11]; string3 = string[3]; var i : byte; function padr(input: string;num:byte):string; begin while length(input) < num do input:=input+' '; padr:=input; end; function Int2Str(I: Longint): String11; var S: string11; begin Str(I, S); Int2Str := S; end; function leading(ch:byte):string3; var piss : string3; begin piss:=int2str(ch); while length(piss) < 3 do piss:='0'+piss; leading:=piss; end; procedure deadmutt; {this is the only procedure i've bothered to write} var yeah : byte; {it displays a ascii table on screen and waites for #13} begin yeah:=0; for i:=14 to 255 do begin if yeah=10 then begin writeln(' '+chr(i)+' '+leading(i)); yeah:=0; end else begin write(' '+chr(i)+' '+leading(i)); inc(yeah); end; end; readln; end; procedure spas(Flags, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES, BP: Word);interrupt; begin asm cli {ints off...} end; case ax of 0001: deadmutt; end; asm sti {and back on again... how intresting...} end; end; begin setintvec($FE, @spas); {setup my interrupt...} keep(0); {go resident... only run this program once, from outside TP} end. {i.e, compile using tp but dont run it util outside tp} .... Platinum Xpress & Wildcat!..... Nice!!!! --- Platinum Xpress/Win/WINServer v3.0pr5 * Origin: Fido/3407 - MS Online - msol.dtdns.net (1:3407/4) . 0