+- Addition-- Subtraction*- Multiplication (signed 16-bit muls.w)/- Division (placeholder - returns 0)%- Modulo (via divs.w, remainder in upper word)
==- Equal (returns 1 or 0)!=- Not equal<- Less than<=- Less than or equal>- Greater than>=- Greater than or equal
Comparison results are:
- 1 (true) if condition holds
- 0 (false) if condition doesn't hold
&&- Logical AND (both operands must be non-zero)||- Logical OR (at least one operand must be non-zero)!- Logical NOT (unary prefix)
Logical results are:
- 1 (true) if condition holds
- 0 (false) if condition doesn't hold
-- Negation (prefix)!- Logical NOT (prefix)&- Address-of*- Dereference
- Unary:
!-&* - Multiplicative:
*/% - Additive:
+- - Comparison:
<<=>>= - Equality:
==!= - Logical AND:
&& - Logical OR:
||
Use 68000 cmp instruction with set conditional byte:
cmp.l d1,d0
seq d0 ; set d0 to 0xFF if equal, 0 otherwise
and.l #0xFF,d0
neg.b d0 ; convert 0xFF to 0x01, 0 stays 0Use conditional branches for short-circuit evaluation:
; a && b
tst.l d0
beq.s .false
tst.l d1
beq.s .false
move.l #1,d0
bra.s .done
.false:
move.l #0,d0
.done:Use 68000 divs.w and swap to get remainder:
divs.w d1,d0
swap d0 ; remainder is now in lower word
ext.l d0 ; sign-extendSee examples/operators_test.has for comprehensive operator examples.