5.1.2 Data Directive
The .data
indicates that the output of the assembly code following should be placed at the end of the .data
(initialized data) section.
# The following symbols (D1 and D2) will be placed in
# the initialized data section.
.data
D1: .long 0x12345678 # 4 bytes
D2: .byte 0xFF # 1 byte
The linker collects initial values for section .data
(and other sections defined with the data attribute) and creates a data initialization template. This template can be processed during application start-up to transfer initial values into memory. For C applications, a library function is called for this purpose automatically. Assembly projects can utilize this library by linking with the libpic32 library. For more information, see 10.4.3 Run-Time Library Support.