Chapter 3/ Hardware Briefing

_hb_Exit:

POP DS

POP AX

POP BX

STI

IRET

One way we can test our TSR is by running the IVT listing code presenied in

the earlier case study. Its output will display the original vectors for the ISRs

that we intend to install and hook.

—Dumping IVT from

bottom up--

-

000 00000000

[CS:IP]

=[00A7,1058]

009 00240000

[CS:IP]

=[020C,040A]

(hook this ISR)

187 02ec0000

[CS:IP]

{instal1 ISR here)

Once we run the TSR.COM program, it will run its main routine and tweak the

IVT accordingly. We'll be able to see this by running the listing program one

more time:

—Dumping IVT from

bottom up--

-

000 00000000

[CS:IP]

=[00A7,I068]

009 00240000

[CS:IP]

= [11F2.0319]

(hooked ISR)

187 02ec0000

[CS:IP]

= [11F2,0311]

(new ISR installed)

As we type in text on the command line, the TSR will log it. On the other

side of the fence, the driver function in the TSR client code gets the address

of the buffer and then dumps the buffer's contents to the console.

void emptyBufferO

{

WORD bufferCS; //Segment address of global buffer

WORD bufferlP; //offset address of global buffer-

BYTE crtIO[SZ_BUFFER]; //buffer for screen output

WORD index; //position in global memory

WORD value; //value read from global memory

//start by getting the address of the global buffer

_asm

PUSH DX

PUSH DI