Commit b36dc68
Implement ND-100 instruction analysis functions for debugger (#5)
Add comprehensive instruction detection and analysis capabilities:
- is_procedure_call(): Detect JPL call instructions
- is_procedure_return(): Detect EXIT return instructions
- get_jpl_target_address(): Calculate JPL target (8-bit displacement)
- is_c_function_prologue(): Detect ENTR stack frame entry
- is_c_function_epilogue(): Detect LEAVE/ELEAV stack returns
Key implementation details:
- Fixed JPL displacement calculation (was incorrectly 11-bit, now correct 8-bit)
- Correctly distinguish JPL/EXIT (L register) vs ENTR/LEAVE (stack LINK)
- ENTR is NOT a call instruction - it's stack frame setup inside functions
- Comprehensive documentation added in docs/INSTRUCTION_ANALYSIS_FUNCTIONS.md
Documentation includes:
- Calling convention details (JPL/EXIT vs ENTR/LEAVE)
- Stack frame layout diagram
- Instruction opcodes and addressing modes reference
- Code examples and debugger usage patterns
Co-authored-by: Ronny Hansen <[email protected]>1 parent bb92e05 commit b36dc68
File tree
2 files changed
+988
-42
lines changed- docs
- src/debugger
2 files changed
+988
-42
lines changed
0 commit comments