Instruction set categorization — which one is NOT an arithmetic instruction? Consider common assembly mnemonics used on microprocessors. Identify the instruction that is not arithmetic in nature.
-
AINC (increment)
-
BCMP (compare)
-
CDEC (decrement)
-
DROL (rotate left)
Answer
Correct Answer: ROL (rotate left)
Explanation
Introduction / Context:Classifying instructions by function helps predict effects on flags, register contents, and performance. Arithmetic instructions change numeric values, while rotate/shift operations manipulate bit positions without performing addition or subtraction.
Given Data / Assumptions:
- INC increments an operand by one.
- DEC decrements an operand by one.
- CMP performs a subtraction to set flags (no stored result), often considered arithmetic/compare.
- ROL rotates bits through the carry or within the word, depending on architecture.
Concept / Approach:
Arithmetic instructions like INC, DEC, ADD, SUB, and CMP act on numeric magnitude and modify arithmetic flags. ROL is a rotate operation (bit manipulation) and is categorized under shift/rotate, not arithmetic, even though it may affect flags such as carry or overflow depending on the CPU.
Step-by-Step Solution:
Recognize that INC and DEC directly change the operand value.CMP computes a subtraction internally to update flags.Identify ROL as a rotate-left bit manipulation instruction.Therefore, select ROL as not arithmetic.Verification / Alternative check:
Review architecture manuals (x86, ARM, 8051): rotate and shift opcodes are grouped separately from arithmetic/logic classes.
Why Other Options Are Wrong:
INC, DEC, and CMP are treated as arithmetic or arithmetic-related flag-setting operations in most ISAs.
Common Pitfalls:
Assuming CMP is purely logical because it does not store a result. It still performs an arithmetic subtraction to set flags.
Final Answer:
ROL (rotate left)