SLAU131Y October 2004 – June 2021
Assemble Into the .data Section
.data
The .data directive sets .data as the current section; the lines that follow will be assembled into the .data section. The .data section is normally used to contain tables of data or preinitialized variables.
For more information about sections, see Chapter 3.
In this example, code is assembled into the .data and .text sections.
1 ; Comments here
2 0000 .data
3 0000 .space 0xCC
4
5
6 ; Comments here
7 0000 .text
8 0000 INDEX .set 0
9 0000 430B MOV #INDEX,R11
10
11
12
13 ; Comments here
14 00cc Table: .data
15 00cc FFFF .word -1
16 00ce 00FF .byte 0xFF
17
18
19
20 ; Comments here
21 0002 .text
22 0002 00CC! con .field Table,16
23 0004 421B MOV &con,R11
0006 0002!
24 0008 5B1C ADD 0(R11),R12
000a 0000
25
26 00cf .data