ROMWBW API

91 views
Skip to first unread message

Kevin Boone

unread,
May 23, 2023, 5:58:41 AM5/23/23
to RC2014-Z80
Hi folks

I have RTFM'd this time, honestly ;)

Is there a way for a CP/M program to determine, safely, that it has access to ROMWBW, rather than some other kind of BIOS or firmware?

Suppose, for example, that I have a utility that needs to know the date. There is a ROMWBW function that provides this information (assuming suitable hardware is installed), but no general CP/M call to link it to. If my program has access to ROMWBW, I would like it to use the appropriate API to get the date; otherwise, it will have to prompt the user.

I see there is an API call to determine whether an RTC device is installed, but how can I tell that ROMWBW is installed? Is there some specific memory signature that can be relied upon?

Best wishes
Kevin

Wayne Warthen

unread,
May 23, 2023, 11:08:11 PM5/23/23
to RC2014-Z80
On Tuesday, May 23, 2023 at 2:58:41 AM UTC-7 Kevin Boone wrote:
Is there a way for a CP/M program to determine, safely, that it has access to ROMWBW, rather than some other kind of BIOS or firmware?

Yes.  As you already realized, you can't make an API call to RomWBW if you don't know it exists.  So, there is no API call for that.  😀

RomWBW very specifically places a signature in the upper area of the CPU memory space.  The address of the signature is found at 0xFFFE.  In other words, a pointer is stored in the top two bytes of RAM (remember, little endian for Z80).  Follow that pointer and if RomWBW is in memory, you will find the following bytes:
  1. Byte value 0x57 (ASCII 'W')
  2. Byte value 0xA8 (inverse of ASCII 'W')
  3. Byte containing major and minor version numbers (one nibble each)
  4. Byte containing update and patch version numbers (one nibble each)
 Thanks,

Wayne
Reply all
Reply to author
Forward
0 new messages