Hacker News new | past | comments | ask | show | jobs | submit login
8088ify: Intel 8080 CP/M 2.2 to Intel 8086/8088 IBM PC DOS assembly translator (github.com/ibara)
43 points by ingve 58 days ago | hide | past | favorite | 20 comments



The Intel tool for this (running on MDS-80 "Blue Boxes" and ISIS-II operating system) was CONV86. I used CONV86 way back in 1983 to convert a fairly large (back then) 8080 assembly language code base to the IBM PC. Worked perfectly.

Compared to the CP/M box it replaced, the IBM PC was a speed demon.



Appendix A has the translation table.


As the article points out, 8086 was designed to be source-translatable from 8080, and DOS started life as a clone of CP/M-86[1], with identical system calls, so it makes a lot of sense that you should be able to mechanically translate 8080 CP/M software to run on DOS.

Z-80 software would presumably be harder to translate, although the x86 has additional registers and instructions you could use.

[1] the rumored easter egg of a Gary Kildall or DRI copyright message hidden in MS-DOS or QDOS was never found, sadly


I recall reading a story where Kildall stated something like, "Ask Bill Gates why '$' is the terminator in the print string call. I know why -- does he?"

In some ways that is the moral equivalent -- the function was copied without fully understanding the why of the function.


That's very interesting - I'd still like to know Bill Gates' answer!!


Why ask Gates and not Tim Paterson in the first place?


Fun historical tidbit: Tim Paterson, the author of 86-DOS (which went on to become Microsoft's famous MS-DOS), did his early 8086 development on a CP/M machine. He wrote an 8086 cross-assembler and also an 8080-to-8086 translator. Eventually, once 86-DOS was up and running, he used the translator to translate his assembler and translator to 8086/DOS code and his OS became self-hosting. The resulting ASM.ASM [1] and TRANS.ASM [2] sources are now finally available thanks to Microsoft's release of the early MS-DOS source code.

[1] https://github.com/microsoft/MS-DOS/blob/master/v1.25/source...

[2] https://github.com/Microsoft/MS-DOS/blob/master/v1.25/source...


This BYTE (June 1982) article compares the register/instruction substitutions of a few translators, including the MS-DOS one (acquired from SCP) and XLT86 (mentioned in the README as the source of 8088ify's translation): https://tech-insider.org/personal-computers/research/acrobat...

I'd not read that Tim Paterson story before. I have read the reverse: he built the filesystem for the Japanese 8-bit MSX computers under a Z80 emulator on MS-DOS, using IBM's BIOS for actual disk I/O. https://www.msx.org/wiki/The_History_of_MSX-DOS


The BYTE article is pure gold - is there any modern publication which combines these sorts of bizarrely entertaining metaphors with the technical details of microprocessor architecture?

> Los Angeles is the 8080, San Francisco is the Z80, Sydney is the 8086, Catholicism is CP/M-86, and Protestantism is MS-DOS.

is officially my new favorite out-of-context quote about early microprocessors and operating systems.


No, BYTE, Dr. Dobbs and the like are relics of a bygone era. Anything that worked was exciting and worth documenting, extrapolating and speculating on. :) Now it's all click driven from what I can tell. :(


This made me smile:

> As many of us home computer users begin transitioning to the IBM PC with its 16-bit Intel 8088 CPU and new IBM PC DOS operating system, we need not bid farewell to our CP/M programs.


And in truth, several important programs of the early PC years were, in fact, clones of the CP/M programs that proceeded them.

Wordstar 3.3 for MSDOS was an exact clone of the CP/M WordStar 3.0 that was released a year or two earlier. Even some of the data sections were in the same place, such that you could copy parts of the configuration data from the CP/M version across to the MSDOS version.


There's also zasm that can convert 8080 to z80: https://k1.spdns.de/Develop/Projects/zasm/Distributions/


This seems less necessary since the Z-80 can actually execute 8080 machine code. I see no reason not to simply allow the Z-80 assembler to accept 8080 mnemonics as well as Z-80 mnemonics.


For a good read regarding translating Microsoft's Fortran compiler from 8080 to 8086 written by the guy that did it see https://retrocomputingforum.com/t/translation-of-8080-code-t...


Now I want an Actually Portable Executable that runs on modern machines and the 8080 as well, perhaps with translation.


I wonder if an awk/perl script for this would be easier to manage.


Likely, but it wouldn't self-host on CP/M or DOS then.


You can get Perl to work on DOS...




Applications are open for YC Winter 2022

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: