FANDOM


hakk.it VM Instruction Set Edit

Math Edit

  • add - performs addition on two numbers
  • sub - performs subtraction on two numbers
  • mul - performs multiplication on two numbers
  • div - performs division on two numbers
  • sin - calculates the sine of a number and stores the result
  • cos - calculates the cosine of a number and stores the result
  • pow - raises a number by an exponent and stores the result

Control Flow Edit

  • lbl - declares a label that control flow operations can use as a target location.
  • goto - performs an unqualified jump to another instruction.
  • call - performs a control flow change that will return to the instruction after the 'call' when a ret instruction is encountered.
  • ret - returns to the instruction after the most recent call instruction that was executed.
  • exit - immediately terminates hakk execution.
  • je - changes control flow when two values equal each otherl
  • jne - changes control flow when two values are not equal.
  • jg - changes control flow when one value is greater than another
  • jl - changes control flow when one value is less than another
  • jge - changes control flow when one value is greater than or equal to another
  • jle - changes control flow when one value is less than or equal to another

Stack Edit

  • push - pushes a value onto the stack
  • pop - pops a value from the stack

Movement Edit

  • moveb - attempts to move a hakk backwards one space in the arena
  • movef - attempts to move a hakk forward one space in the arena
  • turn - attemps to turn a hakk left or right by 90 degrees in the arena

Playfield Edit

Block Specific Edit

Other Edit

  • rem - Adds a remark to the code. Ignored by compiler.
  • nop - Performs a "no operation" in the VM.
  • wait - waits a specified number of machine ticks before moving to the next instruction.
  • out - sends output to STDOUT
  • set - sets a memory location with a literal or value from another memory location
  • rnd - generates a random integer between 0 and a given integer