FPPA簡化指令集

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 3. about 4 years by fellong
  2. 2. about 4 years by fellong
  3. 1. about 4 years by fellong
 

===================
set0 bit     ;位元設0bit  ;位元設0
set1 bit     ;位元設1bit  ;位元設1
tog bit      ;位元0/1切換bit   ;位元0/1切換
swapc bit     ;位元與c切換bit  ;位元與c切換
===================
call addr     ;呼叫副程式addr  ;呼叫副程式
goto addr     ;跳躍到標籤addr  ;跳躍到標籤
icall [index]   ;呼叫指標指到的副程式[index]  ;呼叫指標指到的副程式
igoto [index]   ;跳躍到指標指到的標籤[index]  ;跳躍到指標指到的標籤
delay x      ;延時x   ;延時 x+1 周期
ret / reti /ret x ;副程式返回主程式
nop        ; 空指令nop   ;空指令
pcadd a      ;程式指標+a往下跳(case用法?)a   ;程式指標+a往下跳(case用法?)
engint   ;致能中斷
disgint   ;除能中斷
stopsys   ;系統中止
engint      ;致能中斷reset   ;系統重置
disgint      ;除能中斷
stopsys      ;系統中止
reset       ;系統重置
wdreset      ;看門狗重置wdreset   ;看門狗重置
pmode n      ;fppa分時模式設定n   ;fppa分時模式設定
===================
ceqsn x,y     ;ifx,y  ;if x=y skip
t0sn bit     ;ifbit  ;if b=0 skip
t1sn bit     ;ifbit  ;if b=1 skip
izsn x      ;x+=1,ifx   ;x+=1,if x=0 skip
dzsn x      ;x-=1,x   ;x-=1, if x=0 skip
wait0 bit     ;等待直到bit  ;等待直到 b=0
wait1 bit     ;等待直到bit  ;等待直到 b=1
===================
sr x       ;位元右移,補0x   ;位元右移,補0
src x       ;位元右移,補cx   ;位元右移,補c
sl x       ;位元左移,補0x   ;位元左移,補0
slc x       ;位元左移,補cx   ;位元左移,補c
swap x      ;交換高低x   ;交換高低 4bits
===================
add x,y      ;x=x+yx,y   ;x=x+y
addc x,y     ;x=x+y+cx,y  ;x=x+y+c
nadd x,y     ;x=-x+yx,y  ;x=-x+y
sub x,y      ;x=x-yx,y   ;x=x-y
subc x,y     ;x=x-y-cx,y  ;x=x-y-c
inc x       ;x+=1x   ;x+=1
dec x       ;x-=1x   ;x-=1
clear x      ;x=0x   ;x=0
mul        ;(mulhr,a)=mulop*amul   ;(mulhr,a)=mulop*a
===================
mov x,y      ;x=yx,y   ;x=y
pushw [index]   ;push[index]  ;push index的值或 pc 到 stack
pushw pcN     ;pushpcN  ;push fppN program counter 到 stack
popw [index]   ;從[index]  ;從 stack pop 值到 index
popw pcN     ;從pcN  ;從 stack pop 值到  fppN program counter
ldtabh [index]  ;從 index (word計算)讀取高 byte(到a) ==>rom
ldtabl [index]  ;從 index (word計算)讀取低 byte(到a) ==>rom
ldt16 [index]   ;將[index]  ;將 timer16 值存到 index 中 (??index是2byte計算?) ==>ram
stt16 [index]   ;將[index]  ;將 index 指到的值存回 timer16 (??index是2byte計算?) ==>ram
idxm a,[index]  ;從 ram 中讀值
idxm [index],a  ;從 ram 中存值
xch x       ;將值跟x   ;將值跟 a 交換
===================
and x,y      ;x=xx,y   ;x=x and y
or x,y      ;x=xx,y   ;x=x or y
xor x,y      ;x=xx,y   ;x=x xor y
not x       ;1的補數(反相)x   ;1的補數(反相) x=xnot x
neg x       ;2的補數(負)x   ;2的補數(負) x=-x
comp x,y     ;x-y?x,y  ;x-y?
===================
hb@xxx      ;xxx   ;xxx 的高 byte
lb@xxx      ;xxx   ;xxx 的低 byte
ha@xxx      ;xxx   ;xxx 的位址高 byte
la@xxx      ;xxx   ;xxx 的位址高 byte
===================
$        ;當前pc$   ;當前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