Version 3, last updated by fellong at February 27, 2008 23:05 UTC
===================
set0 bit ;位元設0
set1 bit ;位元設1
tog bit ;位元0/1切換
swapc bit ;位元與c切換
===================
call addr ;呼叫副程式
goto addr ;跳躍到標籤
icall [index] ;呼叫指標指到的副程式
igoto [index] ;跳躍到指標指到的標籤
delay x ;延時 x+1 周期
ret / reti /ret x ;副程式返回主程式
nop ;空指令
pcadd a ;程式指標+a往下跳(case用法?)
engint ;致能中斷
disgint ;除能中斷
stopsys ;系統中止
reset ;系統重置
wdreset ;看門狗重置
pmode n ;fppa分時模式設定
===================
ceqsn x,y ;if x=y skip
t0sn bit ;if b=0 skip
t1sn bit ;if b=1 skip
izsn x ;x+=1,if x=0 skip
dzsn x ;x-=1, if x=0 skip
wait0 bit ;等待直到 b=0
wait1 bit ;等待直到 b=1
===================
sr x ;位元右移,補0
src x ;位元右移,補c
sl x ;位元左移,補0
slc x ;位元左移,補c
swap x ;交換高低 4bits
===================
add x,y ;x=x+y
addc x,y ;x=x+y+c
nadd x,y ;x=-x+y
sub x,y ;x=x-y
subc x,y ;x=x-y-c
inc x ;x+=1
dec x ;x-=1
clear x ;x=0
mul ;(mulhr,a)=mulop*a
===================
mov x,y ;x=y
pushw [index] ;push index的值或 pc 到 stack
pushw pcN ;push fppN program counter 到 stack
popw [index] ;從 stack pop 值到 index
popw pcN ;從 stack pop 值到 fppN program counter
ldtabh [index] ;從 index (word計算)讀取高 byte(到a) ==>rom
ldtabl [index] ;從 index (word計算)讀取低 byte(到a) ==>rom
ldt16 [index] ;將 timer16 值存到 index 中 (??index是2byte計算?) ==>ram
stt16 [index] ;將 index 指到的值存回 timer16 (??index是2byte計算?) ==>ram
idxm a,[index] ;從 ram 中讀值
idxm [index],a ;從 ram 中存值
xch x ;將值跟 a 交換
===================
and x,y ;x=x and y
or x,y ;x=x or y
xor x,y ;x=x xor y
not x ;1的補數(反相) x=xnot x
neg x ;2的補數(負) x=-x
comp x,y ;x-y?
===================
hb@xxx ;xxx 的高 byte
lb@xxx ;xxx 的低 byte
ha@xxx ;xxx 的位址高 byte
la@xxx ;xxx 的位址高 byte
===================
$ ;當前pc
goto $ ;無窮迴圈
===================
.define xxx
.ifdef xxx
.else
.endif
.include "xxx"
x equ y
xxx macro
endm
.ramadr xxxx
.romadr xxxx
word xxx
int xxx
dc xxxx,oooo