COREWAR

/
DIV - Divide
🎯Press [STEP] 3 times to observe integer division at address 0002(0/3)
🟢 EDIT MODE (Click cells to modify)
[Addr][Opcode][A (Left)][B (Right)]
📦 DATA / BOMB (DAT)
+2
0000
+DIV
#
$
0001
↺JMP
$
0002
■DAT
#
#
◎ B-TARGET
0003
■DAT
$0
$0
++ ADD ROW
0004
■DAT
$0
$0
0005
■DAT
$0
$0
0006
■DAT
$0
$0
0007
■DAT
$0
$0
0008
■DAT
$0
$0
0009
■DAT
$0
$0
0010
■DAT
$0
$0
0011
■DAT
$0
$0
0012
■DAT
$0
$0
0013
■DAT
$0
$0
0014
■DAT
$0
$0
0015
■DAT
$0
$0
0016
■DAT
$0
$0
0017
■DAT
$0
$0
0018
■DAT
$0
$0
0019
■DAT
$0
$0
0020
■DAT
$0
$0
0021
■DAT
$0
$0
0022
■DAT
$0
$0
0023
■DAT
$0
$0
0024
■DAT
$0
$0
0025
■DAT
$0
$0
0026
■DAT
$0
$0
0027
■DAT
$0
$0
🏟️ARENA (20 ROWS)SCOPE: 0000 - 0019
[CORE MEMORY 800 CELLS (20 ROWS × 40 COLS)]1:1 Row Synced with Editor
TASKS: 0
CYC: 0
📖REDCODE-94 INSTRUCTION REFERENCE(Drag to move)
📚 REDCODE-94 INSTRUCTION REFERENCE (6/19)

DIV - Divide

DIV: Divide

DIV calculates B / A and stores the integer result in B. Division by zero terminates the process!

Syntax

DIV A, B   ; B = B / A (integer division)

⚠️ Zero Division Trap

If the divisor (A) is zero, the executing process is immediately terminated — similar to executing DAT. This can be exploited as a defensive trap!

Strategic Uses

Defensive Trap

Place a DIV #0 where the enemy might land to kill their process:

trap: DIV #0, 0  ; Any process hitting this dies

Scaling Values

Reduce pointer values for finer-grained scanning:

DIV #2, ptr   ; Halve the scan step

Modifiers

  • .A — Divide A-fields
  • .B — Divide B-fields (default)
  • .F — Divide both fields independently

Notes

Division always produces integer results (floor division). DIV is rarely seen in competitive play but can create unique defensive patterns.

📚 REDCODE-94 INSTRUCTION REFERENCE (6/19)

DIV - Divide

DIV: Divide

DIV calculates B / A and stores the integer result in B. Division by zero terminates the process!

Syntax

DIV A, B   ; B = B / A (integer division)

⚠️ Zero Division Trap

If the divisor (A) is zero, the executing process is immediately terminated — similar to executing DAT. This can be exploited as a defensive trap!

Strategic Uses

Defensive Trap

Place a DIV #0 where the enemy might land to kill their process:

trap: DIV #0, 0  ; Any process hitting this dies

Scaling Values

Reduce pointer values for finer-grained scanning:

DIV #2, ptr   ; Halve the scan step

Modifiers

  • .A — Divide A-fields
  • .B — Divide B-fields (default)
  • .F — Divide both fields independently

Notes

Division always produces integer results (floor division). DIV is rarely seen in competitive play but can create unique defensive patterns.