-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The geas disassembler should be usable not just for inspecting bytecode, but also for editing bytecode. One challenge with this are jumps. The disassembler output for jumps looks like thi:
...
push 0x23
jump
...
jumpdest
...
There is no way to infer where the jump actually goes. To help with this, the disassembler can print PC numbers (geas -d -pc):
...
000a: push 0x23
000c: jump
...
0023: jumpdest
...
This makes jumpdest offsets visible, but it also means the disassembler output is no longer a valid assembler input. But there is no reason it couldn't be. We just have to make numeric labels valid in the input language, and turn them into a kind of assertion. When the assembler encounters a numeric label, it should check the computed PC at that point matches the label.
Metadata
Metadata
Assignees
Labels
No labels