20 lines
529 B
Text
20 lines
529 B
Text
Lookup:
|
|
;input: D0.W = the atomic number of interest.
|
|
LEA PeriodicTable,A0
|
|
ADD.W D0,D0 ;we're indexing a table of words, so double the index.
|
|
MOVE.W (A0,D0),D0 ;D0.W contains row number in the high byte and column number in the low byte.
|
|
RTS
|
|
|
|
PeriodicTable:
|
|
DC.W $FFFF ;padding since arrays start at zero in assembly.
|
|
DC.W $0101 ;HYDROGEN
|
|
DC.W $0118 ;HELIUM
|
|
DC.W $0201 ;LITHIUM
|
|
DC.W $0202 ;BERYLLIUM
|
|
DC.W $0213 ;BORON
|
|
DC.W $0214 ;CARBON
|
|
DC.W $0215 ;NITROGEN
|
|
DC.W $0216 ;OXYGEN
|
|
DC.W $0217 ;FLUORINE
|
|
DC.W $0218 ;NEON
|
|
;etc.
|