Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!lll-winken!catnip!bandy From: bandy@catnip.berkeley.ca.us (Gun Control is Hitting Your Target) Newsgroups: comp.os.cpm Subject: Re: System use of Z80 registers Message-ID: <663@catnip.berkeley.ca.us> Date: 9 Dec 90 17:22:48 GMT References: <9011261759.AA10916@newton> <6209@balu.UUCP> Organization: The People's Number Four Cat Farm, Berkeley CA, USA Lines: 43 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