Skip to content
/ hal Public

A simple assembly-like interpreter written in Java that can execute many instruction quite fast ๐Ÿš€

License

Notifications You must be signed in to change notification settings

Sabo2k/hal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

44 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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