Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 1.96 KB

README.md

File metadata and controls

35 lines (28 loc) · 1.96 KB

HAL

C++

A small Assembly-like Interpreter written in Java C++

Instructions

Name Operand Description
START Start program
STOP Stop program
ADD r Add content of register r to accumulator (acc += registers[r])
SUB r Subtract accumulator with content of register r (acc -= registers[r])
MUL r See ADD and SUB
DIV r See ADD and SUB
ADDNUM n Add the number n to accumulator (acc += n)
SUBNUM n Subtract the number n from the accumulator (acc -= n)
MULNUM n See ADDNUM and SUBNUM
DIVNUM n See ADDNUM and SUBNUM
OUT write content of accumulator into input/output-unit
IN read the from input/output-unit and write content into accumulator
LOAD r Load content of register r into accumulator (acc = registers[r])
LOADNUM n Load number n into accumulator (acc = n)
STORE r Save accumulator into register registers[r] = acc
JUMP a Jump to program adress a
JUMPPOS a Jump to program adress a, if acc is negative
JUMPNEG a Jump to program adress a, if acc is positive
JUMPNULL a Jump to program adress a, if acc is 0

UML Class Diagram