3 ms·
Debug is a passable quick-and-dirty assembler. It's no fun to refactor code after you've resolved all the addresses and hard-coded them into the "source" but wh
by EvanAnderson 3y ago
Debug is a passable quick-and-dirty assembler. It's no fun to refactor code after you've resolved all the addresses and hard-coded them into the "source" but when you're in a pinch and don't have access to real tools it works well.
- netmare 3y agoI "solved" that by using two assembling passes. The first had dummy jump/call addresses in order to determine the code offsets of labels. Then I would resolve the relative offsets, replace the target labels with offset deltas and reassemble. I used that trick to speed up my QBasic programs with graphics, string and list handling, etc. It was one of the first rewarding times in my programming "career" and it actually made me feel proud of myself.
- EvanAnderson 3y agoYeah-- I did the same thing. It just sucks when you've forgotten s prefix or a push/pop early in the code and you have to retarget all the subsequent addresses. It really makes you appreciate a real assembler.
- 48864w6ui 3y agoIf you write basic blocks only with a certain alignment there's much less hand patching imposed for small changes
- EvanAnderson 3y agoI remember reading about people doing that on the Apple II with the Woz mini assembler. I always had an assembler on the 6502 so I never did it myself. Makes sense though. Never thought to do it on x86 but it's a good idea.
- userbinator 3y agoAfter a while, you get really good at hex arithmetic and memorising x86 instruction lengths.