OAMPL
READ var
WRITE const|var|exp
ASSIGN var const|var|exp
IF const|var|exp ... ENDIF
LOOP const|var|exp ... END
where
exp = (op arg arg) | (- arg)
op = +|-|*|/
arg = exp|const|var
|
OAM
ADD addr ; ACC += memory(addr)
SUB addr ; ACC -= memory(addr)
MLT addr ; ACC *= memory(addr)
DIV addr ; ACC /= memory(addr)
SET val ; ACC = val
NEG ; ACC = -ACC
INC ; ACC++
DEC ; ACC--
LDA addr ; ACC = memory(addr), input if addr == 0
STA addr ; memory(addr) = ACC, output if addr == 0
BR addr ; PC = addr
BRP addr ; PC = addr if ACC > 0
BRZ addr ; PC = addr if ACC == 0
NOOP ; does nothing
HLT ; stop
|