The preprocessor is a part of the Assembler, which prepares the source code for the assemble process.
The following parts will be processed by the preprocessor:
Command | Description | Example |
---|---|---|
.equ | create a constant | .equ var = 123.45 |
.set | create/assign a constant | .set var = 123.45 |
.def | Alias | .def temp = R16 |
.device | set the avr controller type | .device atmega32 |
.import | import a label | .import _myLabel |
.importClass1) | import avr class. sets all defines and constants of the selected avr controller inclusive .device | .importClass atmega32 |
.importObject2) | import a library object | .importObject Macro_Delay |
.importUsedObjects3) | imports all in the source code used libraries objects | .importUsedObjects |
.cseg | select flash segment | .cseg |
.dseg | select sram segment | .dseg |
.eseg | select eeprom segment | .eseg |
.org | Sets the pointer of the actual active segment to a specific value | .org intVectorSize |
.error | Display a error message. Break compile/assemble. | .error „message“ |
.warning | Display a warning message. | .warning „message“ |
.message, .print | Display a info message without line number and origin. | .message „message“ |
.regisr | register a label to a interrupt vector „on the fly“ (used for Library Code) | .regisr vectorAddress,mylabel |
.db | (byte) 1 byte each value and strings, data block. 4) | .db „hello“,0x3b |
.dw | (word) 2 bytes each value, data block. 5) | .dw 0x3bda,0xcf01 |
.dt | (triple) 3 bytes each value, data block. 6) | .dt 0xf0d1a4 |
.dl | (long) 4 bytes each value, data block. 7) | .dl 0xff01ddca |
.bin | (file) data block from file byte-wise. 8) | .bin „filepath“ |
.odb | (byte) 1 byte each value and strings, object data block | .odb „hello“,0x3b |
.odw | (word) 2 bytes each value, object data block. 9) | .odw 0x3bda,0xcf01 |
.odt | (triple) 3 bytes each value, object data block. 10) | .odt 0xf0d1a4 |
.odl | (long) 4 bytes each value, object data block. 11) | .odl 0xff01ddca |
.obin | (file) data block from file byte-wise. 12) | .obin „filepath“ |
.dobjend | endmark for object data block with .odb, .odw, … 13))) | .dobjend label |
classServiceudpdDatagram: .odb "this is a message from the luna udpd server",0x0D,0x0A .odb "build with lavrc version ","2013.r6.7",0x0D,0x0A .odb 0x0D,0x0A .dobjend classServiceudpdDatagram
Preprocessor functions expects only constant parameters.