Skip to content

Instruction listing

Addy edited this page Oct 16, 2021 · 4 revisions

Instructions

Note: all of the instructions listed below are lowercase because they're written like so in customasm, which is a case-sensitive assembler.
Legend:

      D = destination
      S = source
      L = label
      A/B = compared values

When an operand starts with % it becomes a pointer. E.g: in the instruction mov D, %S, %S will point to the specified memory address. The destination operand always points to a memory location, but can also point to another pointer (&memory[memory[XX]]).


  • nop - do nothing
  • ext, ret - exit/return from the current scope
  • call L - call the label; jump to the label temporarily
  • int S - call a software interruption, S is the interruption code
  • jmp L - jump to the destination label
  • jeq L - jump to the destination label if the comparison is equal
  • jnq L - ... is not equal
  • jhi L - ... A is higher than B
  • jlw L - ... A is lower than B
  • jhe L - ... A is higher or equal to B
  • jle L - ... A is lower or equal to B
  • mov D, S - move/copy S to D
  • add D, S - add S to D
  • sub D, S - subtract S from D
  • mul D, S - multiply S with D
  • div D, S - divide S by D
  • or D, S - binary OR D with S
  • xor D, S - binary eXclusive OR D with S
  • and D, S - binary AND D with S
  • not D, S - binary NOT D with S
  • shl D, S - left shift bits from D by S times
  • shr D, S - right shift bits from D with S times
  • cmp D, S - compare D to S