XBIOS call invoking another?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
simonsunnyboy
Moderator
Moderator
Posts: 5520
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

XBIOS call invoking another?

Post by simonsunnyboy »

Is it legit to issue another trap #14 within an already running trap #14 handler?
E.g. use the value from a different XBIOS call in a given replacement one?
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2367
Joined: Sun Aug 03, 2014 5:54 pm

Re: XBIOS call invoking another?

Post by ThorstenOtto »

To some degree, yes. However TOS (and also EmuTOS) use the memory that the system variable savptr ($4a2) points to, to save the callers registers. That area is rather limited (5 levels in TOS, 3 in EmuTOS). And of course you are also using more space on the supervisor stack.
simonsunnyboy
Moderator
Moderator
Posts: 5520
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: XBIOS call invoking another?

Post by simonsunnyboy »

Understood however is there a different way to invoke existing functionalities for a TSR which will not replace all calls like EmuTOS does?

For my special usecase I can probably work around the need and implement the necessary functionality in my own code but it would be nice to know if it is allowed.

BTW how does it handled Supexec()? This is a call I use very often to given my code SUpervidor rights for hardware access. IIRC I didn't ran into problems with calling more XBIOS stuffs from that one. Ofcourse I have no idea on nesting with the used TOS.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2367
Joined: Sun Aug 03, 2014 5:54 pm

Re: XBIOS call invoking another?

Post by ThorstenOtto »

You can try to call XBIOS from your function, but i would be careful about that. If some other TSR is doing the same, then you sooner or later run into trouble.

Supexec() is not special in this regard. It saves your registers, then calls your function. If that calls XBIOS again, its about the same as other scenarios.
User avatar
mfro
Atari God
Atari God
Posts: 1167
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: XBIOS call invoking another?

Post by mfro »

Profibuch says Atari said (X)BIOS maximum reentrancy level is three (but requires you to manually adjust the save area).

Anyway, this doesn't help you much if somebody else already exhausted that as Thorsten said.
Post Reply

Return to “Coding”