• Please review our updated Terms and Rules here

Best way to emulate a CP/M machine?

legalize

Experienced Member
Joined
Mar 24, 2006
Messages
391
Location
Salt Lake City, UT, USA
Is there a nice emulator like SIMH or something like that for Windows that will allow me to get CP/M programs from my PC into the emulator and run them?
 
A related question is "do you want to emulate CP/M and a CPU or just the CPU?"

For example 22NICE integrates into the DOS environment, provides the API, translated into DOS calls. There's no CCP and only a skeletal BIOS and BDOS--the heavy lifting is done in native x86 code. Right now, I'm running it on DOSemu under 64-bit Linux, but have run it on 32-bit Windows 7. Similar to what UniDOS did. There's no "there"--files are shared with the host operating system, so I can run CP/M ASM on a file that I've created under Linux.

Code:
             S  T  A  R  T  R  E  K                                   JRM184



        Enter your name, Captain? chuck

Welcome aboard Captain chuck
              Do you want instructions? y

Mr. Spock: STAND BY
Your orders are as follows:
Destroy the 8 Tholian Warships which have
invaded the Galaxy before they can attack Federation
Headquarters on StarDate 3528 . This is in 28 days.
There are 2 StarBases in the Galaxy for resupplying
your ship.

     Type 'GO' when you are ready to assume command.
?
 
In my case, I think I need to start with the full CP/M emulation because I want to play with SL5 that is a FORTH environment for CP/M which can make ROMable images.
 
My own JOYCE emulates a specific CP/M computer (the Amstrad PCW) and has utilities to export and import files to/from the host environment.
 
Is there a nice emulator like SIMH or something like that for Windows that will allow me to get CP/M programs from my PC into the emulator and run them?

Do you want something like SIMH for CP/M emulation that isn't SIMH, or would SIMH itself be fine?

The SIMH AltairZ80 emulation is supposed to include support for running CP/M Version 2.2 according to the current documentation.

github.com/simh/simh/blob/master/doc/altairz80_doc.pdf

I haven't actually tried this out yet myself.

The .dsk image files mentioned in that documentation might be in the files found here:

simh.trailing-edge.com/kits/psaltair.zip
 
Z80pack provides good emulation of a generic CP/M system with either an 8080 or Z80 CPU running at a user configurable speed. It can also emulate specific systems such as an IMSAI 8080, Altair 8800 or Cromemco Z-1 while displaying a great looking front panel and also providing interesting additional emulation of devices such as the Dazzler.
 
In my case, I think I need to start with the full CP/M emulation because I want to play with SL5 that is a FORTH environment for CP/M which can make ROMable images.

I've seen SL5 someplace on one of my machines. Do you have any information on what it is?
Dwight
 
In my case, I think I need to start with the full CP/M emulation because I want to play with SL5 that is a FORTH environment for CP/M which can make ROMable images.

Is it that it has a meta compiler or is it that you just need to take a binary image and convert it to a Intel Hex file?
Dwight
 
Never mind, I see a pdf with instructions to make stand alone applications.

Exactly. This FORTH implementation gives you a way to make a ROMable image. However, it doesn't provide assembly language for the bootstrap code in the distribution, so you need an environment where you can run the original distribution (CP/M .com file) so that you can generate the ROMable image.
 
I use a JAVA emulator (so should run on Windows without recompiling) that is oriented towards the CLI. I use it to create Makefiles for building various CP/M components in an automated fashion. It has a Z80 emulation as well as code to emulate BDOS, BIOS, and basic CCP functions. It operates directly on local files, within the 8+3 naming convention. I also supports "scripts" a la SUBMIT files. It runs at "full speed" (is not throttled to any idea of CPU clock rate). If you are looking to do an "offline build" this may be useful. I've used it to build CP/M3 from source, as well as many other components that I distribute. Let me know if you think this is what you want.
 
Hey Doug, yes that could be handy! At the moment I'm doing more interactive exploring, but for my ultimate purposes and automated build would be handy. Is your Java based emulator OK to use in open source projects?
 
Exactly. This FORTH implementation gives you a way to make a ROMable image. However, it doesn't provide assembly language for the bootstrap code in the distribution, so you need an environment where you can run the original distribution (CP/M .com file) so that you can generate the ROMable image.

What level of boot strap do you need? Do you need to just do CO and CI or are you talking disk access as well?
Dwight
 
The ROM image just targets an embedded device with no console. But from the manual, it looks like you can use all that to debug your environment and then create a minimal ROM image with all the console, etc., stuff dropped out, giving you something like a 2KB minimal image.
 
The ROM image just targets an embedded device with no console. But from the manual, it looks like you can use all that to debug your environment and then create a minimal ROM image with all the console, etc., stuff dropped out, giving you something like a 2KB minimal image.

From what I see, it looks like you only need to define the location of the RAM and how much you need. You could do the entire thing in assembly, without using the Forth engine except for the first entry point. If things were located separately, you'd not even need that. The comgen and sysgen (sp?) look to have a lots of variables that you can access to do different things ( just not well documented ).
When I used Fig-Forth 8080, I didn't do much meta compiling. It wasn't until I was playing a lot with the NC4000 that I would completely recompile the CMForth I ran on it. I used a couple boards from a XT to get both floppy and hard disk ( using the original 5Meg drives that DOS obsoleted ). The system was so fast that I could completely recompile the entire CMForth in less than 10 seconds on a 4MHz NC4000. I ran rings around Intel's 80386. A few minutes later I'd blown EPROMs to run. All on the NC4000.
I'm trying to recall where I saw the SL5 stuff, on disk or on tape someplace.
Dwight
 
From what I see, it looks like you only need to define the location of the RAM and how much you need.

Yep. Seems easy-peasy with this system.

You could do the entire thing in assembly, without using the Forth engine except for the first entry point.

Well, this thing already has a ROM written in assembly that I've spent some time reverse engineering. If you're going to write it all in assembly, why use FORTH in the first place? :p

I'd like to make some modifications, so either I do those in assembly and debug in the deployed system (yuck), or I find a way to debug it before I deploy it. FORTH seems like a good way to develop the changes, assuming I can still meet the timing requirements in FORTH.

I'm trying to recall where I saw the SL5 stuff, on disk or on tape someplace.

I asked over in comp.lang.forth (yes, they're still going strong over there) about a good ROMable 8080 FORTH and that was the recommendation. Then I saw that the distribution requires CP/M in order to build the ROM image, hence this thread of how to run CP/M in an emulated environment.
 
Back
Top