32bit additon on the HC08

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

32bit additon on the HC08

1,494 次查看
Bloodhound
Contributor I
Hi all,

I am assuming this is possible?
I need to be able to increment a number by 254 until it reaches
$06000000.
Can anybody please demonstrate in assembler how this might be done?

Thanks,
Ross

标签 (1)
0 项奖励
回复
2 回复数

668 次查看
Bloodhound
Contributor I
Thanks Peg, makes perfect sense, much appreciated.

Cheers,
Ross
0 项奖励
回复

668 次查看
peg
Senior Contributor IV
Hi Ross,

Anything can be done, it just a matter of how much code is required.
here is a full programme that will run in GP32 simulator.
Code:
 org $40num rmb 4  ;4 bytes of storage org $8000start clr num  ;clear storage clr num+1 clr num+2 clr num+3 loop lda num+3 sta $FFFF  ;reset COP add #$FE  ;add 254 sta num+3 bcc loop inc num+2 bne loop inc num+1 bne loop inc num lda num  ;test MSByte cmp #6  ;for $06 bne loop  ;loop back if not equalend sta $FFFF  ;reset COP bra end  ;loop here when finished org $FFFE  ;reset vector dw start

 

0 项奖励
回复