Compound data type: Difference between revisions

m
Line 44:
=={{header|6502 Assembly}}==
 
The method below is a bit unusual compared to [[C]], where each member of a struct is stored consecutively. The addressing modes of 6502 make it much more efficient to store each member of many different structs consecutively. In other words, the index used to offset into <code>point_x</code> represents which instance of the data type the CPU is accessing. Of course, this assumes that you're willing to declare in advance how many active instances of that data type you'll ever have at once, a very frequent practice in the 8-bit assembly world but is absolutely ludicrous in high-level languages.
 
NESASM3 syntax:
1,489

edits