🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2680

Turbo assembler behaviour

#2680
From: Per M Bergland
Date: Tue, 16 Oct 1990 01:10
65 lines
2339 bytes
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		|
Technical Details
Message-ID: <1990Oct16.011035.8031@watdragon.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!maytag!watdragon!violet.waterloo.edu!pmbergland

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!maytag!watdragon!violet.waterloo.edu!pmbergland
From: pmbergland@violet.waterloo.edu (Per M Bergland)
Subject: Turbo assembler behaviour
Message-ID: <1990Oct16.011035.8031@watdragon.waterloo.edu>
Sender: daemon@watdragon.waterloo.edu (Owner of Many System Processes)
Organization: University of Waterloo
Date: Tue, 16 Oct 90 01:10:35 GMT
Lines: 65