Op Codes
Memory Address
A memory references a location on the stack. The value is an absolute offset from the start of the last stack frame.
Operations
Store Operation
This operation stores an immediate value inside the specified location.
1 |
|
Copy Operation
This operation copies the value of the source location to the destination location.
1 |
|
Branch Operations
1 |
|
Arguments
Available Operations
jmp
: An unconditional jump.jmp_false
: Jumps if the test register is equal to0
.jmp_true
: Jumps if the test register is not equal to0
.
Offset
The offset is relative to the end of the branch instruction in bytes.
With 2 Operands
1 |
|
Arguments
Available Operations
add
,fadd
sub
,fsub
mul
,fmul
sdiv
,udiv
,fdiv
srem
,urem
,frem
: Remainder.and
,or
,xor
: Bitwise operations.eq
,neq
,lt
,leq
,gt
,geq
: All standard comparison functions that yield a boolean. The final result is stored inside the test register.
Available Sizes
8
,16
,32
,64
First Operand
op1 must be a memory address. The result of the operation is store here if not specified otherwise.
Second Operand
op2 must be either a memory address or an immediate.
Examples
The following examples demonstrate the use of the op codes. The actual compiler may optimize the code.
In Bia:
1 2 3 |
|
1 2 3 4 5 6 7 |
|