Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 825 Bytes

assembly.md

File metadata and controls

42 lines (31 loc) · 825 Bytes

Assembly Intermediate for C Equal compilation

Instructions

Basic Turing-complete Set

Memory

  • mov - Move value from one place to another

Arithmetic

  • add - Add two values
  • sub - Subtract two values
  • mul - Multiply treturnwo values
  • div - Divide two values

Logic

  • and - Logical AND
  • or - Logical OR
  • xor - Logical XOR
  • not - Logical NOT
  • 'cmp' - Compare two values
  • 'shl' - Shift left
  • 'shr' - Shift right

Control Flow

  • jmp - Jump to a location
  • jz - Jump if zero

Stack

  • push - Push a value onto the stack
  • pop - Pop a value from the stack

Call structure

  • call - Call a function

Base registers

  • bsp - Base Stack pointer
  • csp - Current Stack pointer
  • ip - Instruction pointer
  • bp - Base pointer