Commit Graph

112 Commits

Author SHA1 Message Date
2b37884a60 fix: align interrupt data with minix src 2025-06-10 09:44:34 +09:00
232b73aad8 chore: Rename Operand -> ImmediateOperand 2025-06-05 10:08:35 +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
4c63b7a21a ft: add dump flag 2025-05-28 16:00:18 +09:00
7e8fdeba54 ft: implement missing lock instruction 2025-05-28 14:23:56 +09:00
a21cc2b4b3 ft: add debug script 2025-05-28 14:13:12 +09:00
c396d33f76 fix: align pointer parsing with spec
Previously pointer parsing was completely wrong.
Now split into Pointer32 for immediates with
segment;offset and Pointer16 for short jumps, which
use DS or ES as segment and the Pointer16 value
as offset.
2025-05-28 13:31:14 +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
3463b5b4ae chore: fix panic
ModRM parsing still used old parsing style.
2025-05-27 09:21:40 +09:00
8ea91d80b8 ft: add first basic test 2025-05-25 21:20:12 +09:00
35207d23f0 chore: add nice debug output 2025-05-25 21:06:47 +09:00
f9ae0dc6ee chore: move pointer parsing function to disasm module 2025-05-25 20:31:55 +09:00
74e936ab76 chore: replace all panic's with proper error propagation 2025-05-25 15:45:09 +09:00
73b1a99cbd ft: Implement memory pointer (Mp) operand 2025-05-25 11:00:47 +09:00
6762195378 chore: show raw pointer value in disasm 2025-05-25 10:27:32 +09:00
90fb88aec6 chore: fix byte/word size ambiguitis in disasm output 2025-05-25 10:09:23 +09:00
058afeb7ba chore: split up some structs and add comments 2025-05-20 18:59:09 +09:00
48eeff16fa chore: align disasm print more with objdump(1) 2025-05-20 11:28:23 +09:00
beccff0d79 chore: update metadata 2025-05-20 11:22:35 +09:00
1173dd3d63 chore: output parity for hex
Output all immediate bytes and words as hex.
2025-05-20 11:02:46 +09:00
ac78e9705c fix: correctly parse jump bytes
Previously only a single byte was read and saved,
but the J-byte means, that the read signed-byte
must be added to the address of the next
instruction.
2025-05-20 10:56:54 +09:00
3fe58e8bac ft: implement fmt::Display for all mnemonics 2025-05-20 10:46:52 +09:00
fd15e57569 fix: correctly add displacement for short jumps 2025-05-20 10:12:13 +09:00
cb924af0fb chore: naming parity 2025-05-15 23:15:22 +09:00
1c7ddbe9fa fix: use unsigned Operand type for immediates 2025-05-15 09:28:28 +09:00
8ff92c81b3 ft: decode last set of instructions 2025-05-15 08:32:49 +09:00
fbec2ddad9 ft: add documentation section to Readme 2025-05-15 01:20:47 +02:00
db6d7c30a9 fix: typo in cargo.toml 2025-05-14 20:55:30 +09:00
beec1ae161 ft: Add Readme 2025-05-14 13:52:02 +02:00
45ab158b95 ft: implement some more instructions 2025-05-14 20:38:51 +09:00
22d7c5571f fix: align disasm output correctly 2025-05-14 20:21:13 +09:00
1aa3e2ba84 chore: align disasm output with intel spec 2025-05-14 16:11:11 +09:00
227f1bd133 fix: fix displacement parsing
1. correctly return when only displacement in modrm mem adressing
Previously the disassmbler wouldn't stop if only a displacement value
should be used without any base or offset index.

2. Displacement can be negative, so use the signed version where applicable
2025-05-14 14:36:21 +09:00
c0bb448d79 chore: prettify printing 2025-05-14 13:54:13 +09:00
5c13267145 ft: implement Group 1 sign extended instruction 2025-05-14 13:45:20 +09:00
1f88db75f5 ft: partially implement Group 5 instructions 2025-05-14 13:41:08 +09:00
4fa789e6bb ft: Implement Group 4 Instructions 2025-05-14 13:35:00 +09:00
986c99873d ft: implement Group 2 instructions 2025-05-14 12:12:57 +09:00
4252986b7e ft: implement CALL and JMP instructions 2025-05-14 11:57:00 +09:00
38a2782cc6 ft: implement group3a/b instructions 2025-05-14 11:46:09 +09:00
04493b1179 ft: implement more mnemonics 2025-05-14 11:28:07 +09:00
b5c178ea61 chore: remove Immediate from Immediate::{Word, Byte, Operand}
It's already clear that its an Immediate value
without the prefix.
2025-05-14 10:40:52 +09:00
a61b82fe22 ft: implement some more mnemonics 2025-05-14 10:39:07 +09:00
f7446c14b1 chore: move register into own module 2025-05-13 16:23:47 +09:00
3cb3f8d4b1 chore: Update comments 2025-05-13 14:25:32 +09:00
6908fb3c69 chore: use lower letters for disasm output 2025-05-13 14:20:25 +09:00