简介:
sub??????? -减法指令
该指令的作用是[源操作数]减[目的操作数],结果传递至[目的操作数],[源操作数]保持不变。
例子:
sub.b d0, d1
?如果d0 = $20 ,d1=$10 ,执行后d1 = $10
?如果d0 = $10 ,d1=$08 ,执行后d1 = $f8
sub.b d0, $100
?如果d0 = $20 ,$100=$10 ,执行后$100 = $10
?如果d0 = $10 ,$100=$08 ,执行后$100 = $f8
sub.b $100, d0
?如果$100=$20 ,d0 = $10 执行后$100 = $10
?如果$100=$10 ,d0 = $08 执行后$100 = $f8
sub.b d1, $10(a0)
如果d1=$20 ,$10(a0) = $10 执行后$100 = $10
?如果d1=$10 ,$10(a0) = $08 执行后$100 = $f8
sub.b $10(a0), d4
如果$10(a0)=$20 ,d4 = $10 执行后$100 = $10
?如果$10(a0)=$10 ,d4 = $08 执行后$100 = $f8
sub.b d5, (a1)
如果d5=$20 ,(a1) = $10 执行后$100 = $10
?如果d5=$10 ,(a1) = $08 执行后$100 = $f8
如果需要使用立即数:
subi.b #$10, d0
?如果d0 = $20 执行后d1 = $10
?如果d0 = $08 执行后d1 = $f8
subi.b #$10,$10(a0)
如果$10(a0) = $20? 执行后d1 = $10
如果$10(a0) = $08 执行后d1 = $F8
?和add指令一样,该指令的目的操作数和源操作数不能同时为内存地址比如以下的为非法代码:
sub.b $00000120, $00000124 ?
sub.w (a0), (a1) ?
sub.l (a0)+, $10($a2) ?
sub.w $9E(a4), -(a3) ?
sub.b $10(a0), $10(a6) ?