CMP - Compare
CMP: Compare (SEQ)
CMP compares operands A and B. If they are equal, the next instruction is skipped. CMP is an alias for SEQ (Skip if Equal).
Syntax
CMP A, B ; Skip next instruction if A == BScanner Usage
Scanners use CMP to detect non-empty cells:
scan: ADD #12, ptr
CMP @ptr, #0 ; Is the cell empty?
JMP attack ; Not empty — attack!
JMP scan ; Empty — keep scanning
attack: MOV bomb, @ptr
JMP scan
ptr: DAT 0, 0
bomb: DAT 0, 0How Skip Works
If the comparison is true (values equal), the Process Counter advances by 2 instead of 1, effectively skipping the next instruction.
Modifiers
.I— Compare entire instructions (both opcode and operands).A— Compare A-fields only.B— Compare B-fields only (default).AB— Compare source A-field with destination B-field
Strategic Notes
CMP with .I modifier is the most effective scanning technique, as it compares entire instructions rather than just values. This makes it harder for opponents to evade detection.