[comp.os.msdos.programmer] Turbo assembler behaviour

pmbergland@violet.waterloo.edu (Per M Bergland) (10/16/90)

Here's a small problem I'm having with Turbo Assembler.
Can anyone explain to me why it doesn't work the way I thought
it would, and if I'm using the wrong approach, correct me?

tasm version 1.0
turbo pascal version 5.5
dos 3.3

I have a turbo pascal unit which contains a variable saveint:PROCEDURE,
and an assembler file looking something like this:

EXTRN saveint:DWORD
(I also tried saveint:FAR with the same result)
CODE SEGMENT BYTE PUBLIC
.MODEL tpascal
.CODE

interruptp PROC FAR
PUBLIC interruptp
push ax
...
(Do some stuff)
(load ds with segment of saveint)
call far [saveint]    (**********)
...
pop ax
pop bp
iret
interruptp ENDP
....
CODE ENDS

And in the unit file it looks something like this:

...
Getintvec(intno,@saveint);
setintvec(intno,Addr(interruptp));
...

Problem:
To get the correct behaviour out of the line marked with (*********)
(to call the old interrupt procedure) I have to substitute the line
with :
call far [saveint+2]
which gives me the result I want, but also a warning from tasm:
"Arithmetic overflow"

OK, I've got a workaround, but it still bothers me not knowing how to
do it properly. Is the bug in tasm, or in my head? ;-)
Tried to find sample code in the manual and in "Mastering Turbo Assembler"
but couldn't find any.
(Don't yell at me for not resetting the value in DS before I call
the old routine. I know what I'm doing... (I hope) (It's the timer interrupt))

-Per

PS. Did anyone read my posting on Borland fonts the other day?
    I didn't get much response...
    Does that mean that nobody knows any more than I do?
    (Frightening thought, isn't it?)
--
| PER M BERGLAND  CS&E student		| snailmail:			|
| email: pmbergland@violet.waterloo.edu	| Rm 322, Minota Hagey Residence|
|  or	 d6caps@dtek.chalmers.se	| U of W, Waterloo, Ontario	|
| (519) 725-6069 (home)	 Fax: Nah!	| CANADA N2L 3G1		|