0
votes

Our task was to write code that worked with a dot matrix printer simulator we were given. I'm fairly certain the implementation of most of that is irrelevant for this question. The main thing is that the tool accepts 32 bit data (the equivalent of a word), and the representation of each letter is 1 byte (8 bit) in size. Attaching consecutive bytes together in an array didn't work because it didn't align on the word boundary, and throwing consecutive bytes at it didn't work either. Is there a better method?

1

1 Answers

0
votes

You can always align a variable on a machine word boundary:

    .align  2
var:
    .word   0 # 4 bytes word-aligned

    .align  2
array:
    .space  32 # 32 bytes word-aligned