Convert bit operation
authorRobert Pengelly <robertapengelly@hotmail.com>
Tue, 22 Jul 2025 22:46:13 +0000 (23:46 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Tue, 22 Jul 2025 22:46:13 +0000 (23:46 +0100)
intel.c

diff --git a/intel.c b/intel.c
index 87ac26893e0196954ec53f442a5838bb0d0ee4f5..cd0c35d77a91648761da1344bf9263c3424f9f50 100644 (file)
--- a/intel.c
+++ b/intel.c
@@ -6311,6 +6311,18 @@ void machine_dependent_assemble_line (char *start, char *line) {
         return;
     }
     
+    if (current_templates[0].start->base_opcode == 0xC0 && instruction.operands == 2) {
+    
+        if (instruction.types[1].imm8 || instruction.types[1].imm8s || instruction.types[1].imm16 || instruction.types[1].imm32 || instruction.types[1].imm32s || instruction.types[1].imm64) {
+        
+            if (instruction.imms[1]->type == EXPR_TYPE_CONSTANT && instruction.imms[1]->add_number == 1) {
+                instruction.operands--;
+            }
+        
+        }
+    
+    }
+    
     /**
      * All Intel instructions have reversed operands except "bound" and some other.
      * "ljmp" and "lcall" with 2 immediate operands also do not have operands reversed.