base:ascii_char_to_4_bit_integer
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:ascii_char_to_4_bit_integer [2015-04-17 04:30] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== ASCII Char to 4 bit integer ====== | ||
+ | |||
+ | This is a very simple routine that converts an ASCII char contained in ' | ||
+ | It can deal with upper/ | ||
+ | nonvalid input like ' | ||
+ | |||
+ | <code 6502acme> | ||
+ | sec | ||
+ | sbc #' | ||
+ | bcc error | ||
+ | | ||
+ | cmp #10 | ||
+ | bcc return | ||
+ | |||
+ | nondigit | ||
+ | and #$3f | ||
+ | cmp # | ||
+ | bcs error | ||
+ | cmp # | ||
+ | bcc error | ||
+ | | ||
+ | sbc # | ||
+ | rts | ||
+ | error | ||
+ | lda #255 | ||
+ | return | ||
+ | rts | ||
+ | </ |
base/ascii_char_to_4_bit_integer.txt · Last modified: 2015-04-17 04:30 by 127.0.0.1