11 lines
517 B
Text
11 lines
517 B
Text
Lookup: ;INPUT: X = atomic number of the element of interest.
|
|
LDA PeriodicTable_Column,x
|
|
STA $20 ;store column number in memory (I chose $20 arbitrarily, you can store it anywhere)
|
|
LDA PeriodicTable_Row,x
|
|
STA $21 ;store row number in memory
|
|
RTS
|
|
|
|
PeriodicTable_Column:
|
|
db $ff,$01,$18,$01,$02,$13,$14,$15,$16,$17,$18,... ;I don't need to write them all out, the concept is self-explanatory enough.
|
|
PeriodicTable_Row:
|
|
db $ff,$01,$01,$02,$02,$02,$02,$02,$02,$02,$02,...
|