- メッセージ出力
HELLO START
OUT BUF,LEN
RET
BUF DC 'HELLO!'
LEN DC 6
END
- ロードとストア
EXLD START
LD GR0, DATA1
LAD GR1, 20
ST GR0, DATA2
ST GR1, DATA3
RET
DATA1 DC 10
DATA2 DS 1
DATA3 DS 1
END
- 演算(減算)
EXSUB START
LD GR1,X
LD GR2,Y
SUBA GR1,GR2
ST GR1,Z
RET
X DC 15
Y DC 6
Z DS 1
END
- 演算(加算と減算)
EXSUB START
LD GR0,X
ADDA GR0,Y
SUBA GR0,Z
ST GR0,W
RET
X DC 90
Y DC 87
Z DC 77
W DS 1
END
- 条件分岐(if)
EXIF START
LD GR1,DATA1
CPA GR1,DATA2
JZE SKIP1
LAD GR2,0
JUMP SKIP2
SKIP1 LAD GR2,1
SKIP2 ST GR2,ANS
RET
DATA1 DC 5
DATA2 DC 5
ANS DS 1
END