No description
Find a file
2014-08-14 17:04:29 +02:00
examples add 2012-02-09 19:30:01 +01:00
.gitignore Clean 2014-08-14 17:04:29 +02:00
CMakeLists.txt migliorie 2012-07-28 15:59:14 +02:00
lib.cpp migliorie 2012-07-28 15:59:14 +02:00
lib.h migliorie 2012-07-28 15:59:14 +02:00
main.cpp migliorie 2012-07-28 15:59:14 +02:00
README Fix overflow 2012-01-15 17:27:39 +01:00

To read the theoretical part go to:
http://en.wikipedia.org/wiki/Random_access_machine

##RAM ISA

load X		M[0] <- M[X]
load= X		M[0] <- X
load* X		M[0] <- M[M[X]]

store X		M[0] -> M[X]
store* X	M[0] -> M[M[X]]

read X		Tape -> M[X]
read* X		Tape -> M[M[X]]

write X		Tape <- M[X]
write= X	Tape <- X
write* X	Tape <- M[M[X]]

// NB: operator can be {add, sub, mul, div}

operator X	M[0] <- M[0] op M[X]	
operator= X	M[0] <- M[0] op X
operator* X	M[0] <- M[0] op M[M[X]]

jmp LABEL	Jump to 'LABEL'
jz LABEL	Jump to 'LABEL' if M[0] = 0
jgz LABEL	Jump to 'LABEL' if M[0] > 0

halt		Stop execution (required)

##Syntax for the emulator

label LABEL	Set 'LABEL' on the next istruction.
debug X		Call the X° debug function.
# XXX		Ignore line 'XXX'

##Debug function

1 		Registers dump.