Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuiltinRegistry = map[string][]*asm.Instruction{ "calculator": Calculator, }
A registry of all the builtin programs. NOTE: All names should be in lower case, as all queries should be.
View Source
var Calculator = []*asm.Instruction{ start.Apply(asm.INP()), asm.STA(mode), asm.INP(), asm.STA(value_o), asm.INP(), asm.STA(value_t), asm.LDA(mode), asm.BRZ(addition), asm.BRA(subtract), addition.Apply(asm.LDA(value_o)), asm.ADD(value_t), asm.BRA(end), subtract.Apply(asm.LDA(value_o)), asm.SUB(value_t), asm.BRA(end), end.Apply(asm.OUT()), asm.HLT(), asm.DAT(mode), asm.DAT(value_o), asm.DAT(value_t), }
A dual-function calculator program. It will prompt for 3 inputs:
- The function to use (0 = addition, 1 = subtract)
- The first number to use
- The second number to use
The program will then output the result.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.