Commit Graph

10 Commits

Author SHA1 Message Date
a5cffa4852 fix(interpreter): impl fetch and decode
I parsed all instructions before executing, but this is not how
intel works.
We need to decode the instructions, pointed to by IP, on the fly.
2025-07-01 12:08:28 +09:00
ef4663a245 ft: abstract and implement ADD::* interpretation 2025-06-04 23:01:04 +09:00
ac69d75273 ft: initial work in interpreter 2025-06-03 21:31:28 +09:00
5ee80c9364 fix: read data section as words, not bytes 2025-06-03 10:30:35 +09:00
0893969f4e chore: whole swoop of enhanced documentation 2025-05-28 09:41:40 +09:00
322a276617 fix: dont interpret padding as instructions
a.out padds the text section with 0-bytes, which where interpreted
as 0x00 0x00 instruction and occasionally as a single 0x00 byte. Add
logic to ignore single 0x00 bytes and to remove dangling 0x00 0x00
instructions at the end of the instruction vec, so only the 'actual'
instructions are presented in the end. Also adjust visibility of
methods, so only the truncated instructions will ever be presented.

Of course, this could remove an actual `0x00 0x00` instruction from the
end, but they would not have any effect on execution anyway.
2025-05-27 11:13:16 +09:00
5c8702fb95 fix: only push raw instruction once 2025-05-27 09:37:57 +09:00
058afeb7ba chore: split up some structs and add comments 2025-05-20 18:59:09 +09:00
1c7d3f3adc fix: cleanup structs into correct files 2025-05-08 10:05:09 +09:00
2af4578c8b ft: initial disasm of example data
This only contains two instructions of which I know
the correct output.
2025-05-07 15:48:44 +09:00