Did Microsoft BASIC (or any of the OEM versions) ever use Z80 only instructions?
For the purposes of this question I'm ignoring the equivalent of BIOS I/O layers which OEMs would have provided.
Retrocomputing Stack Exchange is a question and answer site for vintage-computer hobbyists interested in restoring, preserving, and using the classic computer and gaming systems of yesteryear. It only takes a minute to sign up.
Sign up to join this communityIf you mean if Microsoft BASIC's core ever used Z80 instructions at all, then I would say no - the code of BASIC is designed using 8080 compatible instructions, and all "drivers" are created as appropriate for the platform.
It may happens that some vendors have modified the code to Z80 in order to "compress" it and free some space for special functions, but it must be considered case by case.
Examples: looking to the MSX BASIC, which is designed for Z80 only, with BASIC core in 8080, and extension and BIOS using IX/IY, 0cbh instructions and alternate register set.
Update: following George's answer I decided to take closer look into the MSX BASIC code (starting 4000 and ending approx 7400), and confirm his words:
One suspicious instruction more or less massively used is related to loading/storing DE into memory location, closer look into the code revealed the following cases:
Thus I would consider all this stuff to be special changes for the platform which is expected to have Z80 only.
Yes, Z-80 instructions were used in Microsoft's Z-80 BASIC. For example, look at the TRS-80 Model I or Model III ROM BASIC and you'll find a relative jump JR NZ,0x871
at location 0x88E
. The 8080 does not have relative jump instructions. That instruction is part of a routine to shift CDEB
right by L
bits which is used by the floating point code. Do a PRINT SQR(1)
and you'll see the instruction is hit.
However, it is fair to say that no significant changes were made to the BASIC core when ported from 8080 to Z-80. I don't recall any other Z-80 feature besides relative jumps being used in the core routines. I speculate that they did a quick and perhaps automated pass over the code to take advantage of the byte savings from using JR
instead of JP
and then moved on to machine-specific code which does use Z-80 routines quite significantly.