32bit additon on the HC08

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

32bit additon on the HC08

1,493 Views
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

Labels (1)
0 Kudos
Reply
2 Replies

667 Views
Bloodhound
Contributor I
Thanks Peg, makes perfect sense, much appreciated.

Cheers,
Ross
0 Kudos
Reply

667 Views
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 Kudos
Reply