6

I need to be able to run a very old piece of software -- the HI-TECH z80 C Compiler for CP/M. It has been released as freeware by HI-TECH. Alas, it only runs on CP/M.

After a lot of Googling, I found a page of utilities for UZIX. One of those utilities is a script to abstract away the emulation of a CP/M machine, thus allowing you to use the compiler as you would any other UNIX program. The problem with this script is that it depends on their own CP/M emulator, which unfortunately will not compile on a modern (x64) system.

My question: is there a usable CP/M emulator for Linux that could be used in a similar fashion? Specifically, I need to be able to somehow have it access files from the host system, a la DOSBox. I'm willing to rewrite a script (I don't have to re-use the UZIX one); I just need an emulator. Thanks for any help!

  • Why do you need to use that z80 C compiler? There are others... – Dan D. Dec 9 '12 at 4:16
  • 1
    @DanD. The codebase I have was built for that compiler. Also, HI-TECH's produces higher quality code. – thirtythreeforty Dec 9 '12 at 4:19
  • Darn! I knew I shouldn't have gotten rid of my Osborne! – fixer1234 Nov 18 '14 at 21:48
7

I think z80pack would work well for you. I use it under 64-bit Linux and there are tools available to move files easily between the emulated and host file systems. I wrote a couple of articles a while ago that you may find useful:

Setting up z80pack to create an emulated CP/M sytem

Installing the HI-TECH Z80 C Compiler for CP/M

  • Wonderful; exactly what I was looking for. I should point out that the link to the HI-TECH compiler in your second article is broken, though. – thirtythreeforty Dec 10 '12 at 23:40
  • @gh403 Glad you found it useful. Thanks for letting me know about the links, I have updated the article with new ones. – Lawrence Woodman Dec 11 '12 at 7:06
3

The dosbox program, in spite of its name, is actually a old-style PC emulator that can boot other OS as well.

Check this out:

http://compgroups.net/comp.os.cpm/using-dosbox-to-run-cp-m-86-on-modern-hardware/297836

But I haven't tried it myself.

For Z-80 emulation you might try the TRS-80 emulators, which used a Z-80 chip. I believe you can run CP/M on this also.

http://www.trs-80.com/wordpress/cpm/

  • Interesting... however, I think the HI-TECH compiler was compiled for z80, and DOSBox only emulates the x86 architecture. Unless I'm totally misunderstanding this? – thirtythreeforty Dec 9 '12 at 3:20
  • Oh, sorry, missed that part. – Keith Dec 9 '12 at 3:23
  • Good idea. Although the TRS-80 page you linked to doesn't even mention Linux. – thirtythreeforty Dec 11 '12 at 1:03
  • @gh403 But I have tried that and I know it runs on Linux. I once had 100 TRS-80s running on my one Linux box. :-o – Keith Dec 11 '12 at 1:05
  • CP/M-86 and CP/M-80 are for different architectures. – Thorbjørn Ravn Andersen Apr 26 '18 at 7:21
3

I know this is an old question, but the one I use is this:

https://github.com/jhallen/cpm

It's big advantage over z80pack is that it can emulate the BDOS as well, with the Unix CWD mapped as CP/M drive A:. So you don't need to fiddle around with disk images. You can also wrap scripts around it, for running stuff like Hitech C from Unix. There's even a built-in debugger (which you break into with ^C, which is a little confusing).

  • My answer still stands, but I had to give up on it due to unknown provenance and licensing, sadly. (It borrows code from all over the place and doesn't attribute it properly.) I ended up writing my own; it's not as full featured as the one linked above, but is good enough for running compiler tests (and has a built-in debugger). github.com/davidgiven/cowgol/tree/master/emu/cpm – David Given Apr 4 '18 at 23:02
1

ZXCC was written specifically to run Hi-Tech C within UNIX -- it emulates at BDOS level, so directories on the host system are transparently presented as CP/M drives. It also includes wrappers for the Hi-Tech C compiler and linker.

0

Would this one written in java help??:

http://www.viara.eu/en/j80/J80doc.html

  • Maybe. How would I access the host OS's filesystem? – thirtythreeforty Dec 9 '12 at 4:20
  • I don't think I can help out on this one. Sorry. I could suggest maybe installing a virtual machine of a 32bit linux OS and seeing if that helps compiling of it? It might be just that it doesn't like your 64 bit OS as is dependent on some libraries in the 32 bit and isn't inherent incompatible with compiling on x86 architecture? My best guess for help on this one. – Blisk Dec 9 '12 at 4:28
  • Hm. That's a possibility, I suppose. However, I'm going for the minimum number of emulation layers here ;) – thirtythreeforty Dec 9 '12 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.