June 2025
Intermediate to advanced
152 pages
3h 15m
English
| Practice 21 | Simplify Your Tests Using Tables |
A few years back I wrote an assembler and emulator for the PDP-11, the most popular minicomputer of the 1970s. It was one of those systems where you just had to get it right. A subtle bug in instruction decoding and execution might not reveal itself until some code that the emulator was executing just happened to trigger it.
One set of tests made sure that the emulator could correctly identify which machine instruction it was about to execute. This wasn’t as easy as it sounds—the PDP-11 instruction format was designed to fit as much information as possible into every 16-bit word. Sometimes one word would represent an opcode, two addressing modes, and two registers. Other times it might hold a branch ...
Read now
Unlock full access