base:another_hexadecimal_to_decimal_conversion
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
base:another_hexadecimal_to_decimal_conversion [2020-11-13 21:39] – comments shorter mace | base:another_hexadecimal_to_decimal_conversion [2020-11-14 22:54] – fixed typos in comments mace | ||
---|---|---|---|
Line 25: | Line 25: | ||
// sbc #$05 | // sbc #$05 | ||
// tax | // tax | ||
- | cpx #$ff | + | bpl loop1 |
- | bne loop1 | + | |
END: | END: | ||
rts | rts | ||
Line 35: | Line 34: | ||
loop2: | loop2: | ||
lda table,x // get decimal equivalent of bit in ASCII numbers | lda table,x // get decimal equivalent of bit in ASCII numbers | ||
- | adc #$00 // add carry, is set if the former addition | + | adc #$00 // add carry, is set if the former addition |
beq zero // skip (speed up) when there' | beq zero // skip (speed up) when there' | ||
- | adc result,y // add to whatever result we alread haven | + | adc result,y // add to whatever result we already have |
- | cmp # | + | cmp # |
- | bcc notten | + | bcc notten |
- | sbc # | + | sbc #$0a // subtract 10 |
notten: | notten: | ||
sta result,y | sta result,y |
base/another_hexadecimal_to_decimal_conversion.txt · Last modified: 2020-11-14 23:05 by mace