[旋風][6502匯編][8位HEX轉(zhuǎn)DEC]
2019-04-05 00:25 作者:FlameCyclone | 我要投稿

;[FC][8位HEX轉(zhuǎn)DEC][20190403][加速]
;FlameCyclone
?.ORG $8000
Dec_Digit = $01
DIGIT_COUNT = 05
;零頁占用: 3字節(jié)
;? 程序段: 0x26字節(jié)
;0xFF轉(zhuǎn)換為255耗時118
;0x63轉(zhuǎn)換為99耗時140
;0x09轉(zhuǎn)換為9耗時41
?LDX #$FF
?TXS
?
?LDA #$09
?JSR Hex_To_Dec
?RTS
Hex_To_Dec:
?LDY #$00
Count_100:
?CMP #100
?BCC Set_100
?SBC #100
?INY
?BNE Count_100
Set_100:
?STY Dec_Digit + $02
?LDY #$00
Count_10:
?CMP #10
?BCC Set_10
?SBC #10
?INY
?BNE Count_10
Set_10:
?STY Dec_Digit + $1
SET_1:
?STA Dec_Digit
?RTS
標簽: