Brian Robert Callahan

submited by
Style Pass
2021-06-06 22:30:06

Today I cut the first release of 8088ify, a program that translates Intel 8080 CP/M assembly language to Intel 8086 (8088) MS-DOS assembly language.

While we already wrote an assembler together, that assembler targeted the 8080 CPU. We could run our 8080 programs on our machines but only by way of an emulator that implemented a Zilog Z80 and all the supporting hardware in software that our programs then ran inside. Now, CP/M is not a particularly complex operating system and the 8080 is not a particularly complex CPU, and our modern CPUs are thousands of times faster, so any programs we wrote and assembled with our assembler would run effectively at full speed in an emulator. Another consideration with our assembler is that because it was written in D, our assembler is a cross assembler. That is to say, the assembler runs on a platform other than the one that the assembler outputs programs for. In our case, our assembler runs on any platform that D supports, which includes our OpenBSD development platform. But not CP/M itself.

Unless you happen to own an NEC V20, an emulator is the best we can do to run the programs assembled with our assembler on an x86 machine. And that's fine if that's what we want. But what if we wanted to run our programs natively on our x86 machines? We would need another tool, likely an assembler for x86 and x86_64 machines like nasm. But let's say we've written a lot of fun 8080 programs with our assembler and while we want to run those programs natively on our machine, we do not want to invest the time to manually read through our assembly line by line and rewrite the program in 8086 mnemonics.

Leave a Comment