• Please review our updated Terms and Rules here

NEC V20 and CP/M

Wasn’t this already completely hashed out in a different thread, that at one point even had a link dropped in it to a homebrew board that was basically a copy of an existing Z80 SBC with the CPU replaced by a V20? (Thereby rendering it capable of, yes, running a completely pure CP/M-80 because all the I/O is at 8080-friendly addresses.)

The only peripherals in a standard PC reachable at I/O ports under 100h are the timers/DMA/keyboard/etc, IE, the stuff that’s actually on the motherboard in an IBM 5150. The disk controllers, serial and parallel ports, everything else, are all at higher ports that the 8080 mode of the V20 can’t touch directly.

I would also assume that trying to use the memory mapped video of the PC directly in 8080 mode would be a problem, since most PCs don’t have the text video memory directly adjacent to conventional memory, therefore making it impossible to set up a single 64k segment to hold both your CP/M TPA/BIOS and the 4K of text video buffer, unless NEC added some ability to do “far” memory accesses in 8080 mode without also doing a mode switch.

Edit: https://forum.vcfed.org/index.php?threads/cp-m-80-binaries-on-v20-with-pdos-86-v20.1243908/
 
In my case, I'd implement BIOS calls as trampolines to 8086 code sitting at a fixed location at the bottom of free memory, with the default TPA being in the first free segment above that.

Like, if I needed to write a character, I'd invoke a piece of 8086 code to do it through INT10. If I needed to read or write a sector, I'd invoke a piece of 8086 code to translate the function call, do the buffering/debuffering if needed, and call INT13. So I'm not accessing the hardware directly - I'm going through PC BIOS, the same as DOS does. And just like DOS, I'd have exclusive run of the system.
 
Because then I couldn't avail myself of the existing BDOS code?
 
I have several things to solve or to think of:
- When writing programs for DOS or CP/M, several emulators are available to test things on forehand. AFAIK there isn't an emulator for the V20. There was an discussion on the forum of PCEM to create one but AFAIK nothing happened. That means testing on real hardware. I will use Sergey's XI-8088, equipped with a V20 of course.
- How to transfer the created software? My first idea was to develop it on a PC with a 1.44 MB FDD, something the XI-8088 supports as well. The second idea: a small CF card pre-formatted with a DOS. I can use a card reader to put the software on it from my laptop.
- I'll start simple: just a program that writes something to the screen when in 8080 mode. That means using BRKEM, CALLN and RETEM. Still have to study that interrupt business.
- Then I start to write the BIOS and test every JP one by one.
- JP instead of JMP. I intent to write the BIOS in Z80 for the simple reason that I'm not familiar with 8080 assembly at all. And yes, I know that I only should use 8080 compatible code and pay attention to some differences in the flags. Or is there any reason not to do that?
 
I intent to write the BIOS in Z80 for the simple reason that I'm not familiar with 8080 assembly at all.
I've written 8080 code in both 8080 and Z80 mnemonics, use whatever is more familiar to you.
However, it is very easy to accidentally use a Z80 instruction and lose some time debugging.

I'd like to do what you are trying to do, but I don't have access to a V20 system, so I'll watch from afar.
 
I believe that I posted a copy of CPMEmulator several years ago. That was one of the first targeted to the V20.
CPMEmulator as one word didn't turn up anything on Google. "CPM Emulator" came with tons of links. Would you mind to give us a link, please?

I know there are programs that are able to run single CP/M programs. In 2019 I ran across StevenH's program mentioned in this VCF thread: VCPM15.CMD. It did include source code. This is the one I'm studying now to find out how BRKEM, CALLN and RETEM work. I can find enough BIOSes around, even ones written in Z80 assembly. Now I have to combine these two "pieces" of information.
 
I'll dig the disk out and upload an image if it still reads. Honestly, what was that about the Internet being a good place to preserve information? A drawer in my media filing cabinet does better... :)
 
CPMEmulator as one word didn't turn up anything on Google. "CPM Emulator" came with tons of links. Would you mind to give us a link, please?
I think part of the problem is that it's actually and kitschily named "CPEmulator," but Chuck's not wrong about the modern Web being a terrible place to find stuff. Looks like there's a copy at http://cd.textfiles.com/230/EMULATOR/DIVERSE/CPM/V2080-3/ though. The parent directory has a few others, to boot.

(God bless Jason Scott.)
 
Huh, seems like there were multiple different programs with similar names; the one I linked was written by a Michael Day, not Jay Sprenkle. Go figure...
 
In any case, here's the demo disk contents for CPMulator, GFI Electronics, 1800 Avalon, Olathe, KS. I suspect this was the first; if you have one earlier than 1984, I'll concede.
Did any version of UniDOS ever have a V20/30 emulation mode?
 

Attachments

  • cpmulate.zip
    137.8 KB · Views: 7
It's not even that good. I've kept some bookmarks since 1998 and most of them go to 404s. We're writing 21st century history in quicksand. One of the reason that I support archive.org, with all of its deficiencies.
 
Back
Top