跳到主要内容

V. 指令集

算子的记忆码与语义如下:

记忆码助记符语义
it/id refLD <num>字面量或标识符引用 -> TOS
int constIC <num>小型 2 的补码整数常量 -> TOS
addressAD <num>地址 -> TOS
null parameterNULL缺少 term 属性
addADDTOS = x,y,x + y -> TOS
subtractSUBTOS = x,y,x - y -> TOS
multiplyMULTOS = x,y,x * y -> TOS
divideDIVTOS = x,y,x/y -> TOS
concatenateCONTOS = x,y,x||y -> TOS
unary minusUNINTOS = x,-x -> TOS
load id valueLIVTOS = LD x,V(LD x) -> TOS
load id lengthLILTOS = LD x,V(LD x) -> TOS
load id typeLITTOS = LD x,V(LD x) -> TOS
look up labelLVLTOS = x,AD x -> TOS
stoSTOTOS = x,y,y -> x
returnRETTOS = x,带 x 返回给调用者
branch trueBTTOS = AD x,AD x -> 指令计数器
branch falseBFTOS = AD x,AD x -> 指令计数器
branchBUTOS = AD x,AD x -> 指令计数器
compare equalCEQTOS = x,y,(y.EQ.x) -> TRUE/FALSE 标志
compare not equalCNETOS = x,y,(y.NE.x) -> T/FF
compare <=CLETOS = x,y,(y.LE.x) -> T/FF
call outputOUTTOS = r,t,v,l,(r,t,v,l) -> 输出
call inputIN(INC = 比较,INN = 不比较)TOS = r,t,v,l,(r,t,v,l) -> TOS
current -> initialSCIPCIP -> IIP(保存当前输入指针 - 初始输入指针)
initial -> currentSICPIIP -> CIP(保存初始输入指针 - 当前输入指针)