先把示例代码写好,到时候实现虚拟机就有目的性了...
MOV [0],1
MOV [1],1
MOV [2],2
MOV [[0]],-1
PRT[0]
PRT[1]
PRT[2]
LOOP [[0]] BEGIN
ADD [1],[2]
MOV [0],[1]
MOV [1],[2]
MOV [2],[0]
PRT [2]
END
输出结果应该是1,1,2,3,5,8,13......
2024-03-30 19:00:57
先把示例代码写好,到时候实现虚拟机就有目的性了...
MOV [0],1
MOV [1],1
MOV [2],2
MOV [[0]],-1
PRT[0]
PRT[1]
PRT[2]
LOOP [[0]] BEGIN
ADD [1],[2]
MOV [0],[1]
MOV [1],[2]
MOV [2],[0]
PRT [2]
END
输出结果应该是1,1,2,3,5,8,13......