←back to thread

118 points mariuz | 1 comments | | HN request time: 0.198s | source
Show context
mati365 ◴[] No.45655689[source]
Writing compilers for old CPUs has some real magic in it. It helps you see how processors really work and brings back the old days when hardware was simple and easy to understand. I miss that time. I once wrote a small C compiler in TypeScript for the Intel 8086 and 8087 ([1]), and I have huge respect for the people who coded for those chips. It’s super hard but also very rewarding.

[1] https://github.com/Mati365/ts-c-compiler

replies(4): >>45655833 #>>45656775 #>>45658223 #>>45662182 #
1. PaulHoule ◴[] No.45658223[source]
The Z-80 was one of the best compiler targets of that age, but the 8086 was even better. Everyone was amazed at the very fast Turbo Pascal compiler for the Z-80 that got ported to 8086. I had an 80286 computer and Turbo Pascal was my favorite programming language because the compiler was fast, execution was fast, and the language was extended enough that you could do most systems and applications programming in Pascal -- you could easily link assembly language procedures such as replacements for the stdlib zero and copy routines that took advantage of new instructions and wider paths to 2x those functions.