Date : Sun, 09 Dec 1990 17:22:48 GMT
From : catnip!bandy@lll-winken.llnl.gov (Gun Control is Hitting Your Target)
Subject: System use of Z80 registers
I agree with Bridger, disagree with Tilmann and give my take on the
situation, plus official word from DRI.
Bridger Mitchell writes:
>> I (and others) have long argued strenuously for strict adherence to
>> the following systems-programming guideline:
>>
>> ****
>> SYSTEM CODE (BIOS, BDOS, INTERRUPT-SERVICE ROUTINES, AND BACKGROUND
>> UTILITIES) SHOULD *ALWAYS PRESERVE* THE NON-8080 REGISTERS.
>> ****
>>
>> This rule ensures that an application that uses Z80 opcodes can run on
>> any z80 system without having to save and restore any of those
>> registers before every BIOS and BDOS call.
tilmann@cosmo.UUCP (Tilmann Reh) writes:
>That's a guideline I don't agree with.
>Why should the system care about which registers the application program uses?
Why? "Because CP/M is an **8080** operating system - thus it may only use
8080 registers." I got this reply back from Digital Research back in '80
when I asked them about the Z/80 registers.
>Of course, interrupt routines must also save all registers they use, as this
>are asynchronous events.
That's right, but the silly people who did the Osborne-1 roms didn't.
Hence perfectly valid Z80 applications that ran on other folks' systems
would crash on the Osborne.
>When will programmers (system *and* application) finally understand that
>everything should be programmed as portable and universal as possible ?
Exactly.
Yes, it would make an application even more bullet proof to have it save
all the Z80 registers [or don't use them :-)] before it called into
BDOS/BIOS, but folks who write BIOS software should preserve the Z80
registers to help maintain compatibility with "incorrect" software.
--
real address: bandy@catnip.berkeley.ca.us
last choice: lll-winken!catnip.berkeley.ca.us!bandy