Here's the latest version of my BIOS3.ASM: View attachment BIOS3.ASM.txt
XOR A
DEC A
LD A,$FF
OR A
Is the simplest way without resorting to complex mental arithmetic.
The only reason you needed the flags setting was not for CPM (it uses the VALUE in the A register) but for your own implementation of conin.
Dave
A>sysinfo
Processor: Z80
System: CP/M 3.1
Top of TPA: EF00
BIOS start: F500
BDOS start: EF00
Common base: C000
Drives: A: B: C: D: E: F: G: H:
LD A,$FF
OR A
Is the simplest way without resorting to complex mental arithmetic.
The only reason you needed the flags setting was not for CPM (it uses the VALUE in the A register) but for your own implementation of conin.
It's unfortunate that you only have one bootable image in your disk layout, because that forces you into one or the other.
Yeah okay, fair points. I've got it good at the moment as I have CP/M 2.2, from which I can switch to CP/M 3 if the mood takes me. Can't get much more flexible than that.
That's an interesting observation. I wonder how difficult it would be to create a bootable CP/M 3 image on drive D, then have the option to boot from A or D in the ROM...? At the moment, you type 'cpm' and it loads sector 0 from drive A...
Can you remind me - what are you using for your disk?
Option at boot time for disk to boot from?
The concept of an 'if I screw up my configuration how do I recover' situation is well worth consideration from the outset.
We have this with our 'mainframes' at work - when making changes to the CLM_USER file, if you make an error you need a recovery disk to boot from! You can use the front panel to bypass the offending item - but even this can leave you with an unusable system.
Dave
One way to implement a multi-boot option would be to keep the disk layout as-is, and make the CP/M 2.2 image on track 0 be the "loader" for any other OS. If you can pass the boot command to the CP/M 2.2 image, it could do some custom actions in the cold boot path, instead of starting CP/M 2.2.
One tricky area is the CP/M concept of "drive A:" vs. "partition 0" on the flash disk. Right now, your BIOS hard-codes drive A: to partition 0, etc. But for a multi-boot setup you'd want "drive A:" to be whichever partition is appropriate for the OS you are booting. If you solve this problem, then your CP/M 2.2 BIOS cold boot could do something like this:
1) check boot command, default is to jump to CP/M 2.2 normally, OTHERWISE:
2) select a CCP command based on boot command, for example "cpm3" might map to "D:CPMLDR".
3) Place that command into the CCP command buffer, which will cause CCP to execute it immediately on starting.
4) jump to CCP.
The D:CPMLDR.COM, as well as BIOS3 in CPM3.SYS, would have to "swizzle" the disk partition mapping such that "drive A:" was actually partition 3 (or wherever you want CP/M 3 to be). You could go further and modify CPMLDR to accept commandline options and then use those to swizzle drive mapping and pass those along to BIOS3 for the same.