Article View: comp.sys.atari.st
Article #40271Re: How to call the bios ...
From: Edgar Roeder
Date: Fri, 12 Jan 1990 17:49
Date: Fri, 12 Jan 1990 17:49
34 lines
1737 bytes
1737 bytes
In article <1937@atari.UUCP>, apratt@atari.UUCP (Allan Pratt) writes:
> I think it's a reentrancy problem. The OS hooks seem to use external
> storage, meaning they're non-reentrant. Worse, they all use the SAME
> external location, so in a given program, you can't call BIOS from
> BIOS, but you also can't call XBIOS from BIOS!
> [...]
> Hooks like this can be made reentrant by changing how they work:
> [example how to do it by copying the arguments]
There is another solution: use your own stack for saving the return address.
(This is also the method used in the ROM when bios is called.)
move.l stackpointer,a0
move.l (sp)+,-(a0)
move.l a0,stackpointer
trap #$x
move.l stackpointer,a0
move.l (a0)+,-(sp)
move.l a0,stackpointer
rts
You have to initialize the variable stackpointer to point to the upper end of
some memory space reserved for this new stack. Although this does only allow
a limited level of reentrancy (the stack-space divided by the amount needed for
every call), you don't have to copy your arguments around.
- Edgar
--
Mail: Edgar R\"oder E-Mail: roeder@cs.uni-sb.de
Liesbet-Dill-Stra\ss e 3
D-6602 Dudweiler -o- -o-
W-Germany ^
Phone: 06897/74643 '---'
Technical Details
Message-ID:
<2116@sbsvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!unido!sbsvax!roederReferences:
<9001060449.AA23484@TIS.COM> <1937@atari.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!unido!sbsvax!roeder From: roeder@sbsvax.UUCP (Edgar Roeder) Newsgroups: comp.sys.atari.st Subject: Re: How to call the bios ... Summary: one more solution Message-ID: <2116@sbsvax.UUCP> Date: 12 Jan 90 17:49:42 GMT References: <9001060449.AA23484@TIS.COM> <1937@atari.UUCP> Organization: Universitaet des Saarlandes, Saarbruecken, W-Germany Lines: 34