32bit additon on the HC08

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

32bit additon on the HC08

1,539件の閲覧回数
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 返答(返信)

713件の閲覧回数
Bloodhound
Contributor I
Thanks Peg, makes perfect sense, much appreciated.

Cheers,
Ross
0 件の賞賛
返信

713件の閲覧回数
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 件の賞賛
返信