Question about general BIOS behavior regarding register usage

Door Edevaldo

Master (154)

afbeelding van Edevaldo

15-01-2019, 02:32

I was looking into the Technical Reference manual and Red Book regarding register usage in some of the BIOS routines.

Taking BEEP (0x00C0) as an example, documentation says all registers are clobbered. Disassembling the function I noticed IX,IY return intact (and SP off course), as is expected from a BIOS that is mostly 8080 code.

The question is... is it safe to assume those 2 registers are always preserved when docs say all registers are clobbered? What is the behavior regarding AF',BC',DE',HL' ?

Thanks a lot!

Aangemeld of registreer om reacties te plaatsen


Enlighted (6010)

afbeelding van NYYRIKKI

15-01-2019, 07:34

Unfortunately it is not quite that simple. CALBAS and CALSLT are good examples that use index registers/shadow registers. There might be also differences between MSX versions. In MSX2 and up many of the subroutines were moved to SUBROM and I would expect that because of the previously mentioned examples there might be differences in register usage... I know for sure that there are at least differences in interrupts enabled/disabled status after a BIOS call between MSX versions. If I would make some assumptions, I would test the end result properly in different MSX versions.