6 ms·
Really, the mistake was letting humans provide input to computer programs.
by lenerdenator 3y ago
Really, the mistake was letting humans provide input to computer programs.
- layer8 3y agoIn particular input to assemblers, compilers, and interpreters.
- 082349872349872 3y agoI once wrote a 16-bit assembler as a recursive function, which emitted code and fixed data on the way down and patched in relative offsets on the way back up. In principle, one might worry about blowing the stack, but as the sole purpose of this function was to assemble at most a half-k boot sector, in practice they fit.
- blueflow 3y agoIm curious about that. At which point did you do the recursion? "Assemble everything after this line and tell me offset of symbol X when you are done" ?
- 082349872349872 3y agoYes. (well: tell me the entire symtab when you are done, but you probably could've guessed that)
- kragen 3y agoi seem to recall you wrote a sort of 16-bit assembler in machine code consisting entirely of printable ascii, except for a couple of places where it had to use printable ascii instructions to modify itself to add instructions like int 21 that couldn't be done that way. but that was a different one, wasn't it?
- 082349872349872 3y agoYes, and not an assembler but the inverse of a hex-dump. (although that is very close to an assembler for the subset of programs consisting only of .byte foo, bar, bletch, ... directives)
- kragen 3y agohmm, i thought maybe that was the version where you had one- or two-byte labels for the (hexadecimal) instructions
- 082349872349872 3y agoOh yeah, I'd forgotten about that one! hmm...