about summary refs log tree commit diff stats
path: root/subx/031check_operands.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-12-03 23:26:56 -0800
committerKartik Agaram <vc@akkartik.com>2018-12-03 23:26:56 -0800
commit5f3b3e7aea4174f13da9b430538564c68257b647 (patch)
tree64b0ca70a7508aa10a008ad7d996f5d4f38214c8 /subx/031check_operands.cc
parentee73f5eb31e9dd5a185da097bd990ac94c3d282b (diff)
downloadmu-5f3b3e7aea4174f13da9b430538564c68257b647.tar.gz
4830
New helper: printing a byte in textual (hex) form.

This required adding instructions for bitwise shift operations.
Diffstat (limited to 'subx/031check_operands.cc')
-rw-r--r--subx/031check_operands.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/subx/031check_operands.cc b/subx/031check_operands.cc
index f59fb005..949bc533 100644
--- a/subx/031check_operands.cc
+++ b/subx/031check_operands.cc
@@ -212,18 +212,24 @@ void init_permitted_operands() {
   // pop
   put(Permitted_operands, "8f", 0x01);
 
-  //// Class O: op, ModR/M and subop (not r32)
+  //// Class N: op, ModR/M and subop (not r32)
   //  imm32 imm8  disp32 |disp16  disp8 subop modrm
   //  0     0     0      |0       0     1     1
+  put(Permitted_operands, "d3", 0x03);  // shift
   put(Permitted_operands, "f7", 0x03);  // test/not/mul/div
   put(Permitted_operands, "ff", 0x03);  // jump/push/call
 
-  //// Class N: op, ModR/M and imm32
+  //// Class O: op, ModR/M, subop (not r32) and imm8
+  //  imm32 imm8  disp32 |disp16  disp8 subop modrm
+  //  0     1     0      |0       0     1     1
+  put(Permitted_operands, "c1", 0x23);  // combine
+
+  //// Class P: op, ModR/M and imm32
   //  imm32 imm8  disp32 |disp16  disp8 subop modrm
   //  1     0     0      |0       0     0     1
   put(Permitted_operands, "c7", 0x41);  // copy
 
-  //// Class P: op, ModR/M, subop (not r32) and imm32
+  //// Class Q: op, ModR/M, subop (not r32) and imm32
   //  imm32 imm8  disp32 |disp16  disp8 subop modrm
   //  1     0     0      |0       0     1     1
   put(Permitted_operands, "81", 0x43);  // combine