3.6. Data Directives

The .byte, .word, .dword and .text directives are used to generate byte, word (one word= two bytes), dword (double word = 4 bytes) and text data as in standard 65xx assemblers.

.byte 1,2,3,4      // Generates the bytes 1,2,3,4
.word $2000,$1234  // Generates the bytes $00,$20,$34,$12
.dword $12341234   // Generates the bytes $34,$12,$34,$12
.text "Hello World"

You can use .by, .wo and .dw as aliases for .byte, .word and .dword, so '.by $10' is the same as '.byte $10'.

With the .fill directive you can fill a section of the memory with bytes. It works like a loop and automatically sets the variable i to the byte number.

.fill 5, 0 // Generates byte 0,0,0,0,0
.fill 5, i // Generates byte 0,1,2,3,4
.fill 256, 127.5 + 127.5*sin(toRadians(i*360/256)) // Generates a sine curve