From 39cd650ad35201035843badfd89f81f247bb67d4 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 14:59:11 -0700 Subject: [PATCH 1/9] conveninet -> convenient --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index 138c084f8704..bf73e3149e0b 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -87,7 +87,7 @@ we need to make sure the preceding instruction is always valid and terminates at our desired instruction boundary. Through examination of the `Primary` opcode map, it is obsereved that -0x50-0x5f are all 1 byte instructions. These become conveninet padding. +0x50-0x5f are all 1 byte instructions. These become convenient padding. After each necessary instruction we insert enough padding bytes to fill the maximum instruction length and leave at least one additional one byte From 85910479f9535eaf6989428644ce276343674193 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 14:59:53 -0700 Subject: [PATCH 2/9] disassambly -> disassembly --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index bf73e3149e0b..6610ca667b1a 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -54,7 +54,7 @@ sample instruction disassembly. The process entails - Generating a necessary set of instructions - Generating parsable disassembly for the instructions -- Parsing the disassambly +- Parsing the disassembly ### Generating a necessary set of instructions From b3901172e717f0b29e473a1f35dadf48e9eeeb6b Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 15:00:36 -0700 Subject: [PATCH 3/9] disassebly -> disassembly --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index 6610ca667b1a..037fbe9e9f10 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -323,7 +323,7 @@ respective descriptions. ## Limitations -The approach of using a single object file as the source of disassebly +The approach of using a single object file as the source of disassembly samples, is restricted to a max compilation/link unit size. Early drafts were generating more instructions, and couldn't be compiled. From c97cc6ad5365ea9e2584e8b1744c04117e5983e4 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 15:01:31 -0700 Subject: [PATCH 4/9] dissassembly -> disassembly --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index 037fbe9e9f10..292f0de91f21 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -193,7 +193,7 @@ Windows disassembler may also work. Not attempted. # Parse disassembly and generate code cat opcodes.intel | dotnet run > ../amd64InstrDecode.h ``` -#### Finding releavant dissassembly lines +#### Finding releavant disassembly lines We are not interested in all lines in the disassembly. The disassembler stray comments, recovery and our padding introduce lines we need to ignore. From 8f805b40bedb4a92d15657dd857e26fee848c891 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 15:03:38 -0700 Subject: [PATCH 5/9] obsereved -> observed --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index 292f0de91f21..416c766e3dd9 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -86,7 +86,7 @@ To make sure the disassembler attempts to disassemble every instruction, we need to make sure the preceding instruction is always valid and terminates at our desired instruction boundary. -Through examination of the `Primary` opcode map, it is obsereved that +Through examination of the `Primary` opcode map, it is observed that 0x50-0x5f are all 1 byte instructions. These become convenient padding. After each necessary instruction we insert enough padding bytes to fill From b7cb4aaeb4f4b8dc7fc0d5d9941526534c87e79a Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 15:04:49 -0700 Subject: [PATCH 6/9] releavant -> relevant --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index 416c766e3dd9..000e8996843f 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -193,7 +193,7 @@ Windows disassembler may also work. Not attempted. # Parse disassembly and generate code cat opcodes.intel | dotnet run > ../amd64InstrDecode.h ``` -#### Finding releavant disassembly lines +#### Finding relevant disassembly lines We are not interested in all lines in the disassembly. The disassembler stray comments, recovery and our padding introduce lines we need to ignore. From 5bdb46f2f10f6e47830517f13475fc563b690685 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 15:05:12 -0700 Subject: [PATCH 7/9] teh -> the --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index 000e8996843f..5686761d07ad 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -80,7 +80,7 @@ We will iterate through all the necessary set. Many of these combinations will lead to invalid/undefined encodings. This will cause the disassembler to give up and mark the disassemble as bad. -The disassemble will then resume trying to diassemble at teh next boundary. +The disassemble will then resume trying to diassemble at the next boundary. To make sure the disassembler attempts to disassemble every instruction, we need to make sure the preceding instruction is always valid and terminates From 82ee314e841e20853e303e48cc4a0627588bdf26 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 15:06:01 -0700 Subject: [PATCH 8/9] thes -> these --- src/debug/ee/amd64/gen_amd64InstrDecode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md index 5686761d07ad..d7a317201492 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/README.md +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/README.md @@ -275,7 +275,7 @@ For a few other instructions the `L`, `W`, `vvvv` value may the instruction change behavior. Usually these do not change mnemonic. The set of instructions is therefore usually grouped by the opcode map and -`opCodeExt` generated above. For thes a change in `opCodeExt` or `map` +`opCodeExt` generated above. For these a change in `opCodeExt` or `map` will start a new group. For select problematic groups of `modrm.reg` sensitive instructions, a From 3a2e939fded0fc18040a6c7f67dc80455aee0fa8 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 3 Sep 2019 15:07:28 -0700 Subject: [PATCH 9/9] Instructio -> Instruction --- ...eGenerator.cs => Amd64InstructionTableGenerator.cs} | 10 +++++----- ...or.csproj => Amd64InstructionTableGenerator.csproj} | 0 2 files changed, 5 insertions(+), 5 deletions(-) rename src/debug/ee/amd64/gen_amd64InstrDecode/{Amd64InstructioTableGenerator.cs => Amd64InstructionTableGenerator.cs} (99%) rename src/debug/ee/amd64/gen_amd64InstrDecode/{Amd64InstructioTableGenerator.csproj => Amd64InstructionTableGenerator.csproj} (100%) diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructioTableGenerator.cs b/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.cs similarity index 99% rename from src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructioTableGenerator.cs rename to src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.cs index 91d357e0a892..9e2ce2da1190 100644 --- a/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructioTableGenerator.cs +++ b/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text.RegularExpressions; -namespace Amd64InstructioTableGenerator +namespace Amd64InstructionTableGenerator { [Flags] public enum EncodingFlags : int @@ -152,7 +152,7 @@ static Amd64InstructionSample() {"lidt", (e) => { return SuffixFlags.M10B;}}, {"sgdt", (e) => { return SuffixFlags.M10B;}}, {"sidt", (e) => { return SuffixFlags.M10B;}}, - {"vlddqu", (e) => { return Amd64InstructioTableGenerator.Amd64L(SuffixFlags.M32B, SuffixFlags.M16B, e);}}, + {"vlddqu", (e) => { return Amd64InstructionTableGenerator.Amd64L(SuffixFlags.M32B, SuffixFlags.M16B, e);}}, {"vprotb", (e) => { return SuffixFlags.M16B;}}, {"vprotd", (e) => { return SuffixFlags.M16B;}}, {"vprotq", (e) => { return SuffixFlags.M16B;}}, @@ -499,7 +499,7 @@ public SuffixFlags parseSuffix() } - class Amd64InstructioTableGenerator + class Amd64InstructionTableGenerator { List samples = new List(); @@ -514,7 +514,7 @@ class Amd64InstructioTableGenerator Dictionary> opcodes; int currentExtension = -8; - Amd64InstructioTableGenerator() + Amd64InstructionTableGenerator() { regExpandOpcodes = new List<(Map, int)>() { @@ -926,7 +926,7 @@ void WriteCode() static void Main(string[] args) { - new Amd64InstructioTableGenerator(); + new Amd64InstructionTableGenerator(); } } } diff --git a/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructioTableGenerator.csproj b/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.csproj similarity index 100% rename from src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructioTableGenerator.csproj rename to src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.csproj