A&S

From Esolang
Jump to navigation Jump to search

main

rules

R(0-30)(contain always) & PC are registers. RIO register is for I/O

ADD A <- B //comment!
SUB A <- B //A and B are pointer (A-Z,AA-ZZ,AAA-ZZZ)
ADD PC <- A //jump PC+1+A
JEZ A //do [ADD PC <- R1] if A equal 0 else do nothing
SUB PC <- R1 //halt
SET A <- B: //SET is name. A & B is arguments

codes

P.S. for use these macros. type in start this <mfs.A&S> P.S.S. the mfs decode as macro function set

set

SET A <- B:
 SUB A <- A
 ADD A <- B

not op

NOT A:
 SET X <- R1
 ADD PC <- A
 ADD X <- R1
 SUB X <- R1

or op

OR A B:
 SET Y <- A
 ADD Y <- B
 ADD PC <- Y
 ADD PC <- R3
 SET X <- R1
 SET X <- R1
 ADD PC <- R1
 SET X <- R0

and op

AND A B:
 SET Y <- A
 ADD Y <- B
 ADD PC <- Y
 NOP
 ADD PC <- R1
 ADD PC <- R2
 SET X <- R0
 ADD PC <- R1
 SET X <- R1

nop op

NOP:

mul op

MUL A <- B:
 SET Y <- A
 SET A <- R0
 SET YY <- B
 ADD A <- Y
 SUB YY <- R1
 JEZ YY
 SUB PC <- R4

equal op

EQU A B:
 SET Y <- A
 SUB Y <- B
 JEZ Y

end

Page made by User:Timm