Hacker News new | past | comments | ask | show | jobs | submit login

Just sprinkle a few NOPS in your 6502 assembly regularly, so you can replace it later with JMP.



Wait wut?


If you programmed in machine code (without a fancy assembler), you can't simply move your instructions around in memory to make room for bugfixes, so instead you place a couple of nops here and there (usually in strategic places like the start of a function or right after a conditional branch, so that you can later replace those nops with jumps or subroutine calls to add patches.


OK, I get it now. You brought me back. I now do remember peppering my X86 asm code with those nops when writing early code generators, for example if a JMP instruction might go past 127 bytes.


http://www.neocomputer.org/projects/et/ has some really good examples of that kind of debugging (reusing existing space/instructions)




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

Search: