This repository has been archived by the owner on Jan 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Instruction Listing
Mithun Hunsur edited this page Nov 11, 2015
·
14 revisions
Opcode | Instruction | Operands | Description |
---|---|---|---|
Pseudo | push |
Push the given register onto the stack (i.e. add sp, -4; store sp, register ). |
|
Pseudo | pop |
Pop the given register from the stack (i.e. load register, sp; add sp, 4 ). |
|
Pseudo | loadi |
Load the given 32-bit immediate, or label, into a register. | |
Pseudo | db |
Create arg1 bytes, each containing arg2 . |
|
Pseudo | rep |
Repeat the following instruction arg1 times. |
|
0x00 |
load |
dst, src |
Loads the value located in [src] into dst . |
0x01 |
store |
dst, src |
Stores the value located in src into [dst] . |
0x02 |
loadli |
dst, imm |
Load the immediate into the lower half of src . |
0x03 |
loadui |
dst, imm |
Load the immediate into the upper half of src . |
0x04 |
move |
dst, src |
Copy the value in src to dst . |
0x05 |
add |
dst, src, src |
Add src1 and src2 together, and store the result in dst . |
0x06 |
add |
dst, imm |
Add the immediate to dst , and store the result in dst . |
0x07 |
sub |
dst, src, src |
Subtract src2 from src1 , and store the result in dst . |
0x08 |
mul |
dst, src, src |
Multiply src1 by src2 , and store the result in dst . |
0x09 |
div |
dst, src, src |
Divide src1 by src2 , and store the result in dst . |
0x0A |
not |
dst, src |
Bitwise-NOT src , and store the result in dst . |
0x0B |
and |
dst, src, src |
Bitwise-AND src1 with src2 , and store the result in dst . |
0x0C |
or |
dst, src, src |
Bitwise-OR src1 with src2 , and store the result in dst . |
0x0D |
xor |
dst, src, src |
Bitwise-XOR src1 with src2 , and store the result in dst . |
0x0E |
shl |
dst, src, src |
Shift src1 by src2 bits to the left, and store the result in dst . |
0x0F |
shr |
dst, src, src |
Shift src1 by src2 bits to the right, and store the result in dst . |
0x10 - 0x1F |
Unallocated opcodes (16 free) | ||
0x20 |
cmp |
dst, src |
Compare dst to src , and update the flags register appropriately. |
0x21 |
j |
label |
Jump to the given label unconditionally. |
0x22 |
je |
label |
If the zero flag is set, jump to the given label. |
0x23 |
jne |
label |
If the zero flag is not set, jump to the given label. |
0x24 |
jgt |
label |
If the greater flag is set, jump to the given label. |
0x25 |
jlt |
label |
If the less flag is set, jump to the given label. |
0x26 - 0x3E |
Unallocated opcodes (25 free) | ||
0x3F |
halt |
Halt operation. |