TPA size

60 views
Skip to first unread message

Robb Bates

unread,
Nov 4, 2025, 12:47:34 PMNov 4
to RC2014-Z80
Is there a BIOS or BDOS routine that can find the top of the TPA automatically?

I want the data in my program to be able to grow as much as possible without crashing into the BIOS/BDOS/Loader at the top of memory.

I believe RomWBW is only 512 bytes at the top, but I can't assume only RomWBW users will run this.

Robb

j.skists

unread,
Nov 4, 2025, 12:58:05 PMNov 4
to RC2014-Z80
If I remember rightly, from playing around with RSX code, I think the usual way is to read the address at &0006 which is the bdos vector. Perhaps AND that with &FF00.

Justin. 


--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/rc2014-z80/71074b44-9833-4645-b239-074de96b4983n%40googlegroups.com.

Peter Onion

unread,
Nov 4, 2025, 12:58:34 PMNov 4
to rc201...@googlegroups.com
On Tue, 2025-11-04 at 09:47 -0800, Robb Bates wrote:
> Is there a BIOS or BDOS routine that can find the top of the TPA automatically?
>
> I want the data in my program to be able to grow as much as possible without crashing
> into the BIOS/BDOS/Loader at the top of memory.
>

Robb,

The trick used top be (back in the 1980s) to use address from the BDOS entry jump in
location 5. That jumped top the first byte used by the BDOS and anything below that was
classed as TPA.

I've not checked if that is still valid on current systems.


PeterO



Robb Bates

unread,
Nov 4, 2025, 1:12:05 PMNov 4
to RC2014-Z80
Yep, just found it in the CPM3 manual.  You two gave me an idea where to look.

" Thus, the Page Zero interface allows programs to run without regard to where the operating system modules are located in memory. In addition, transient programs can use the address at location 0006H as a memory ceiling."

This works even if RSXs are loaded apparently.

Thanks,
Robb

j.skists

unread,
Nov 4, 2025, 1:17:29 PMNov 4
to RC2014-Z80
Yes. RSX tuck themselves at the top (relocatable code) on a 256byte boundary, put their own BDOS vector in at &0006 and then chain the BDOS call to the original one if it wasn't for them.

Justin



--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

Jonathan Harston

unread,
Nov 4, 2025, 6:06:36 PMNov 4
to RC2014-Z80
On Tuesday, 4 November 2025 at 18:17:29 UTC j.skists wrote:
Yes. RSX tuck themselves at the top (relocatable code) on a 256byte boundary, put their own BDOS vector in at &0006 and then chain the BDOS call to the original one if it wasn't for them.

Yes, like this, if this makes sense:

ANSI.gif
Reply all
Reply to author
Forward
0 new messages