Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Modifying cpu registers while in turbo pascal interrupt routine ?

44 views
Skip to first unread message

Skybuck Flying

unread,
Mar 17, 2004, 6:18:49 PM3/17/04
to
Hi,

Turbo pascal 7 has the 'interrupt' directive which can be placed behind a
procedure name to turn it into a interrupt handler.

procedure interrupt_handler(Flags, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES,
BP: Word); interrupt;
begin


end;

All cpu registers will be copied into these parameters.

The documentation says that after the interrupt routine is done all these
parameters will be stored back into the cpu registers.

The problem is that these parameters are probably passed 'by value'. So
these are only copies.

When modifieing these parameters it is useless (?) because they are not
placed back into the cpu registers ???????

Is that true... ?

How does one write a decent interrupt routine for turbo pascal where cpu
registers can be modified... since the driver which calls the interrupt
routine excepts certain cpu registers to be changed/set. For example to
buffers.

Skybuck.


Skybuck Flying

unread,
Mar 17, 2004, 6:52:48 PM3/17/04
to
Actually it is for a packet driver in dos.

Maybe I have to manually set the interrupt routine in the interrupt vector
table or will the packet driver do that ?


Skybuck Flying

unread,
Mar 17, 2004, 7:46:49 PM3/17/04
to
Nope...

It seems the problem was with setting the ethernet card address.

The test program was setting the ethernet address of the network card to
decimal:

10:20:30:40:50:60

Just to test it for fun...

Somehow that prevented the network card from receiving any packets.

"Skybuck Flying" <nos...@hotmail.com> wrote in message
news:c3antc$djd$1...@news2.tilbu1.nb.home.nl...

Skybuck Flying

unread,
Mar 17, 2004, 8:06:38 PM3/17/04
to
Ok,

I think I have found the culprit...

The test program calls: 'reset interface' function.

This function is not working properly anyway... (it does not clear multicast
list and does not re-fetch address from rom)

Disabling this function from the test program makes it work and receive
packets :D

If a send a packet of ethernet/ip/udp and data 395... the test will show 437
bytes received...

( First I thought that can't be right ethernet is only 14 bytes :) but I
forgot the other protocol headers :) )

Hmm let's see... 14 bytes for ethernet header + 20 bytes for ip + 8 = 42
bytes.

437 - 42 = 395 matches perfectly !!! :D

Yes !!!

It seems pascal interrupts do work like they should !!! :D

I apologize for this :D lol Stupid me ! :D

Wieeeeeeeeeeeeeeeeeeeehhhhhhhhhhhhhhheeeeeeeeeeeeeeeeee :):):):):):):):)

Skybuck.


Skybuck Flying

unread,
Mar 17, 2004, 8:19:19 PM3/17/04
to
Man... great... :)

It says so in the specification lol:

"
Resets the interface associated with handle to a known state,
aborting any transmits in process and reinitializing the -> receiver <-
"

Ofcourse I didn't know what that ment ? "reinitializing"

Could mean anything :)

Apperently it just disables the receiver...

Probably nil or so :)

That's why the receiver never gets called...

Also for most packet drivers 'packets lost' will never increase
also bytes in will never increase...

For some packet drivers this might still work...

So apperently for most packet drivers the receiver needs to be initialized
and working etc... otherwise statistics won't get updated...

( but for some it still will ? or maybe those packet drivers are buggy...
who knows :) could be anything :) ) :)

0 new messages