FANDOM


Description Edit

A [VM] instruction that subtracts one number from another and stores the result.

Usage Edit

sub: [{store}, {num1}, {num2}]

hakkML Example Edit

name: sub_example
blocks:
  core:
  entry: {name: 'main', loc : [0,1]}
code:
  main:
    - rem: subtracts two literals, stores result in core.0
    - sub: [core.0, 4, 2]
    - rem: subtracts a literal from a number stored in core.0, stores result in core.1
    - sub: [core.1, core.0, 2]
    - rem: outputs '0'
    - out: core.1
    - exit: 0