Peter Mawhorter
Assembly Syntax | Meaning (R = register file, M = data memory) |
Opcode | Rs | Rt | Rd |
---|---|---|---|---|---|
ADD Rs, Rt, Rd | R[d] ← R[s] + R[t] | 0010 | s | t | d |
SUB Rs, Rt, Rd | R[d] ← R[s] - R[t] | 0011 | s | t | d |
AND Rs, Rt, Rd | R[d] ← R[s] & R[t] | 0100 | s | t | d |
OR Rs, Rt, Rd | R[d] ← R[s] | R[t] | 0101 | s | t | d |
LW Rt, offset(Rs) | R[t] ← M[R[s] + offset] | 0000 | s | t | offset |
SW Rt, offset(Rs) | M[R[s] + offset] ← R[t] | 0001 | s | t | offset |
BEQ Rs, Rt, offset | If R[s] == R[t] then PC ← PC + 2 + offset * 2 |
0111 | s | t | offset |
JMP offset | PC ← offset * 2 | 1000 | offset | ||
HALT | Stops the program | 1111 | ignored |
Assembly Syntax | Meaning (R = register file, M = data memory) |
Opcode | Rs | Rt | Rd |
---|---|---|---|---|---|
ADD Rs, Rt, Rd | R[d] ← R[s] + R[t] | 0010 | s | t | d |
SUB Rs, Rt, Rd | R[d] ← R[s] - R[t] | 0011 | s | t | d |
AND Rs, Rt, Rd | R[d] ← R[s] & R[t] | 0100 | s | t | d |
OR Rs, Rt, Rd | R[d] ← R[s] | R[t] | 0101 | s | t | d |
LW Rt, offset(Rs) | R[t] ← M[R[s] + offset] | 0000 | s | t | offset |
SW Rt, offset(Rs) | M[R[s] + offset] ← R[t] | 0001 | s | t | offset |
BEQ Rs, Rt, offset | If R[s] == R[t] then PC ← PC + 2 + offset * 2 |
0111 | s | t | offset |
JMP offset | PC ← offset * 2 | 1000 | offset | ||
HALT | Stops the program | 1111 | ignored |