I've seen lots of posts on this. Trying to keep it very simple. Was wondering if anyone had any thoughts.
Trying to essentially keep a score tallying (no problem with drawing or using a digit-based solution). I can make it work by seeding the additive...like, if I'm adding a three digit number to a three digit number, if I:
LDA #$0
STA add
LDA #$5
STA add+1
LDA #$1
STA add+2
...and run the routine, I can successfully appear to add 150 to the score, no problem there.
The problem I'm having is using this simple, quick method with variable numbers. So for instance, if I had a table with point-values for various objects (I'm ok with everything being worth <256, so I only need a byte), what would be the simplest way to get a hex value broken into 'places'?
For instance...hex value $64 = 100. What would be the best method or converting $64 to seed a 1 in the 'hundreds' additive, a zero in the 'tens' additive, and a zero in the 'ones' additive?
I can imagine creating three separate 256 byte LUTs to handle this, but that seems dreadfully inefficient and wasteful. Surely, there has to be some better method, and maybe I'm just looking at it too close?
Thanks!
Trying to essentially keep a score tallying (no problem with drawing or using a digit-based solution). I can make it work by seeding the additive...like, if I'm adding a three digit number to a three digit number, if I:
Code:
LDA #$0
STA add
LDA #$5
STA add+1
LDA #$1
STA add+2
...and run the routine, I can successfully appear to add 150 to the score, no problem there.
The problem I'm having is using this simple, quick method with variable numbers. So for instance, if I had a table with point-values for various objects (I'm ok with everything being worth <256, so I only need a byte), what would be the simplest way to get a hex value broken into 'places'?
For instance...hex value $64 = 100. What would be the best method or converting $64 to seed a 1 in the 'hundreds' additive, a zero in the 'tens' additive, and a zero in the 'ones' additive?
I can imagine creating three separate 256 byte LUTs to handle this, but that seems dreadfully inefficient and wasteful. Surely, there has to be some better method, and maybe I'm just looking at it too close?
Thanks!