
The abCore16 C-Like language is designed for 16-bit operations and addressing. Our comprehensive instruction set supports arithmetic, bitwise, memory, I/O, stack, jump, and subroutine operations.
These instructions move data between registers, memory, and immediate values.
Mnemonic Operands Opcode Description
LOAD Rd, #imm16 0x01 Load Immediate: Loads a 16-bit immediate value into destination register Rd.
LOADM Rd, addr16 0x03 Load from Memory: Loads a 16-bit value from the specified memory address into Rd.
STORE Rs, addr16 0x02 Store to Memory: Stores the 16-bit value from source register Rs to the specified memory address.
LOADFR Rd, R_base, #off16 0x04 Load Frame-Relative: Loads a value from memory at address [R_base + signed_offset] into Rd. Used for accessing stack variables.
STORFR Rt, R_base, #off16 0x05 Store Frame-Relative: Stores the value from Rt to memory at address [R_base + signed_offset]. Used for accessing stack variables.
LOADI Rd, Rs_addr 0x06 Load Indirect: Loads a value from the memory address specified in Rs_addr and places it into Rd. Rd = Mem[Rs_addr].
STORI Rt_val, Rs_addr 0x07 Store Indirect: Stores the value from Rt_val into memory at the address specified in Rs_addr. Mem[Rs_addr] = Rt_val.
MOV Rd, Rs 0x80 Move Register: Copies the value from source register Rs to destination register Rd.
PUSH Rs 0x60 Push to Stack: Decrements the Stack Pointer (SP), then stores the value of Rs at the new stack-top address.
POP Rd 0x61 Pop from Stack: Loads the value from the current stack-top address into Rd, then increments the Stack Pointer (SP).
These instructions perform standard mathematical calculations. They affect the ZF, SF, CF, OF flags.
Mnemonic Operands Opcode Description
ADD Rd, Rs 0x10 Add: Adds the value of Rs to Rd and stores the result in Rd. Rd = Rd + Rs.
SUB Rd, Rs 0x11 Subtract: Subtracts the value of Rs from Rd and stores the result in Rd. Rd = Rd - Rs.
MUL Rd, Rs 0x12 Multiply: Multiplies the value of Rd by Rs and stores the 16-bit result in Rd. Rd = Rd * Rs.
INC Rd 0x13 Increment: Adds 1 to the value in Rd. Rd = Rd + 1.
DEC Rd 0x14 Decrement: Subtracts 1 from the value in Rd. Rd = Rd - 1.
CMP R1, R2 0x40 Compare: Compares the values in R1 and R2 by performing a subtraction (R1 - R2) but only updates the flags, without storing the result.
These instructions perform boolean and bit-level manipulations.
They affect the ZF, SF flags and clear CF, OF.
Mnemonic Operands Opcode Description
AND Rd, Rs 0x20 Bitwise AND: Performs a bitwise AND between Rd and Rs. Stores the result in Rd.
OR Rd, Rs 0x21 Bitwise OR: Performs a bitwise OR between Rd and Rs. Stores the result in Rd.
XOR Rd, Rs 0x22 Bitwise XOR: Performs a bitwise XOR between Rd and Rs. Stores the result in Rd.
NOT Rd 0x23 Bitwise NOT: Inverts all bits in Rd.
SHL Rd, #imm8 0x24 Shift Left: Shifts the bits in Rd to the left by the specified 8-bit amount.
SHR Rd, #imm8 0x25 Shift Right: Shifts the bits in Rd to the right by the specified 8-bit amount.
L_AND Rd, R1, R2 0x26 Logical AND: If R1 != 0 AND R2 != 0, sets Rd to 1; otherwise sets Rd to 0.
L_OR Rd, R1, R2 0x27 Logical OR: If R1 != 0 OR R2 != 0, sets Rd to 1; otherwise sets Rd to 0.
L_NOT Rd, Rs 0x28 Logical NOT: If Rs == 0, sets Rd to 1; otherwise sets Rd to 0.
These instructions alter the flow of program execution.
Mnemonic Operands Opcode Description
JMP addr16 0x50 Jump: Unconditionally sets the Program Counter (PC) to the target address.
CALL addr16 0x70 Call Subroutine: Pushes the return address (current PC + 3) onto the stack, then jumps to the target address.
RET (none) 0x71 Return from Subroutine: Pops an address from the stack and jumps to it.
JE addr16 0x53 Jump if Equal: Jumps to the target address if the Zero Flag (ZF) is 1. (Used after CMP).
JNE addr16 0x54 Jump if Not Equal: Jumps if ZF is 0.
JS addr16 0x55 Jump if Sign: Jumps if the Sign Flag (SF) is 1 (result was negative).
JNS addr16 0x56 Jump if No Sign: Jumps if SF is 0 (result was positive or zero).
JC addr16 0x57 Jump if Carry: Jumps if the Carry Flag (CF) is 1.
JNC addr16 0x58 Jump if No Carry: Jumps if CF is 0. JO addr16 0x59 Jump if Overflow: Jumps if the Overflow Flag (OF) is 1.
JNO addr16 0x5A Jump if No Overflow: Jumps if OF is 0.
JMPZ Rs, addr16 0x51 Jump if Register is Zero: Jumps to the target address if the value in Rs is 0.
JMPN Rs, addr16 0x52 Jump if Register is Negative: Jumps if the most significant bit of Rs is 1.
These instructions handle interaction with the outside world and control the CPU state.
Mnemonic Operands Opcode Description
OUTM Rs, addr16 0x33 Output to Memory-Mapped Address.
INP Rd 0x30 Input: Reads a 16-bit value from the default input device into Rd.
OUT Rs 0x31 Output: Writes the 16-bit value from Rs to the default output device.
INM Rd, addr16 0x32 Input from Memory-Mapped Address: Reads a value from a specific MMIO address into Rd.
OUTM Rs, addr16 0x33 Output to Memory-Mapped Address: Writes the value from Rs to a specific MMIO address.
MOVFRSP Rd 0x81 Move From Stack Pointer: Copies the value from SP into Rd.
MOVTOSP Rs 0x82 Move To Stack Pointer: Copies the value from Rs into SP.
NOP (none) 0x00 No Operation: Does nothing for one clock cycle.
HALT (none) 0xFF Halt: Stops the CPU from executing any more instructions.
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.