From f368df374077936886c953b8a2520e4ac4e11f2d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 2 Oct 2023 13:26:42 -0400 Subject: [PATCH] Updated Internal Encoding of x86 Encodings (markdown) --- Internal-Encoding-of-x86-Encodings.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Internal-Encoding-of-x86-Encodings.md b/Internal-Encoding-of-x86-Encodings.md index 08e8cc6..3e1f6ca 100644 --- a/Internal-Encoding-of-x86-Encodings.md +++ b/Internal-Encoding-of-x86-Encodings.md @@ -29,4 +29,12 @@ Therefore each decoded instruction is: * between 4 and 10 bytes for 16-bit decodings; and * between 4 and 16 bytes for 32-bit decodings. -`sizeof(Instruction)` is therefore either `10` or `16`; it provides `packing_size` to give the size in bytes that are actually in use. `Instruction` is plain-old-data with a trivial destructor so it is safe to place them into memory such that instruction n+1 is placed at the address of instruction n + its `packing_size()`. Extension words therefore need be paid for only when required. \ No newline at end of file +`sizeof(Instruction)` is therefore either `10` or `16`; it provides `packing_size` to give the size in bytes that are actually in use. `Instruction` is plain-old-data with a trivial destructor so it is safe to place them into memory such that instruction n+1 is placed at the address of instruction n + its `packing_size()`. Extension words therefore need be paid for only when required. + +### Future Notes + +If instruction length in bytes turns out to be less helpful than originally expected, it might be worth dropping it entirely and moving repetition or segment override into the instruction. Segment override in particular might avoid some conditionality in execution of cached instructions, where the process for indirections is currently: + +* use override if specified; +* otherwise check for an indirect source and, if one is present, see whether it has a base that implies a default segment; +* otherwise use DS. \ No newline at end of file