LC-3 汇编语言 指令简介

192 阅读1分钟

ADD       0001       Dst  Src  1 Imm5

              Dst = Src + Imm5

              0001       Dst  Src1 0 00 Src2

              Dst = Src1 + Src2

 

AND       0101       Dst  Src  Src  1 Imm5

              Dst = Src And Imm5

              0101       Dst  Src  Src  0 00 Imm5

              Dst = Src And Imm5

 

NOT       1001       Dst  Src  111111

              Dst = Not Src

 

LD          0010       Dst  PCoffset9              PC相对寻址

              Dst = PC + offset9

 

LDI         1010       Dst  PCoffset9              间接寻址

              Dst = PC + offset9

 

LDR        0110       Dst  BaseR     PCoffset6              基址偏移寻址

              Dst = BaseR + offset6

 

LEA        1110       Dst  PCoffset9              立即数寻址

              Dst = PC + offset9

 

ST          0011       Src  PCoffset9

              PC + offset9 = Src

 

STI          1011       Src  PCoffset9

              PC + offset9 = Src

 

STR        0111       Src  Base offset6

              Base + offset6 = Src

 

 

BR          0000       nzp PCoffset9

              n:<0 z:=0  p:>0

              If nzp then -> PC + offset9

 

JMP        1100       000 Base 000000

è Base

 

TRAP      1111       0000 trapvector

              Trapvector    x21 字符输出 x23 键盘输入 x25 终止程序

image.png

image.png