4 ms·
Not snark, but a serious question: What would one use this for?
by nielsbot 5y ago
Not snark, but a serious question: What would one use this for?
- unbanned 5y agoEducation
- woodruffw 5y agoI do a lot of program analysis work, and it's occasionally useful to see the pre- and post-machine states of arbitrary instructions. I have my own (more? less?) hacky version of this program that I use for that purpose; I know other people use GEF and similar GDB extensions for similar purposes.
- qsort 5y agoFor visually exploring the results of applying instructions. Similar to how you would use jshell.
- sebow 5y agoLearning assembly can be a pain, especially without something like gdb (with layout regs &layout asm). This is much simpler and doesn't require you to type like 4-5 extra commands(start gdb, put breakpoint, set layouts, step through the code),thus avoiding the pain that gdb can be for very-simple asm programs.
- tenderlove 5y agoI wrote it because I can never remember what the `test` instruction does to the zero flag. Every time I use the instruction I have to look up the docs. Looking up docs is fine, but running code in a REPL helps me remember things better.
- tzot 5y agoI believe in most (if not all) architectures that have it, a test instruction is the same as comparing to zero; so testing zero sets the zero flag :)
- mkup 5y agoTEST instruction in x86/x64 is the same as AND instruction (bitwise and), but result of the computation is discarded (only flags are retained).
- tzot 5y agoThanks; my assembly experience was with earlier processors, with a single argument for their test instruction (kind of like calling x86 test with two same arguments). I should have checked what the x86 test instruction does before replying.
- djmips 5y agoIt's a shame that modern debuggers don't have mini-assemblers included like the original Apple II. Having a REPL would be real nice. For one I wouldn't have to type 90 (NOP) into memory windows to blank out code like non mortal ASSERTS.
- 6bfdc1954b8e 5y agoShellcode testing I suppose.