GAL 1.0 - Assembly Language Playground

New to GAL? Read the introduction or the user manual, or try the exercises.

ACC: 0The accumulator: the lights show its lowest 16 bits; the decimal value is always exact

PC : 0The program counter: the number of the next instruction to run, counting from 0 (ignoring comments, labels and DAT lines). The lights show its lowest 8 bits

HALT: The HALT light shows dark: not finished, amber: halted correctly, red: program error

Instruction set

CLR clear the accumulator
LOD load the accumulator from a cell or with a constant
STO store the accumulator into a data cell
ADD add a cell or constant to the accumulator
SUB subtract a cell or constant from the accumulator
INC add 1 to the accumulator
DEC subtract 1 from the accumulator
NEG negate the value in the accumulator
MUL multiply the accumulator by a cell or constant
DIV divide the accumulator by a cell or constant
MOD modulo divide the accumulator by a cell or constant
RDN read a number into the accumulator (error if no number remains)
RDC read the next character into the accumulator (0 when input ends)
PRN output the accumulator as a number
PRC output the accumulator as a character
JMP jump to a code label
JEZ jump to a code label if the accumulator is zero
JNZ jump to a code label if the accumulator is not zero
JLZ jump to a code label if the accumulator is less than zero
JGZ jump to a code label if the accumulator is greater than zero
HLT stop execution
NOP do nothing
DAT declare a data cell (label required), e.g. FOO: DAT 10