| |||||||||||||
Technical Support On-Line Manuals RealView Assembler User's Guide | Layout of assembly language source files
The general form of source lines in assembly language is:
{NoteInstructions, pseudo‑instructions, and directives must be preceded by white space, such as a space or a tab, even if there is no label. All three sections of the source line are optional. You can use blank lines to make your code more readable. Instruction mnemonics, directives, and symbolic register names can be written in uppercase or lowercase, but not mixed. To make source files easier to read, a long line of source can be split onto several lines by placing a backslash character ( NoteDo not use the backslash/end‑of‑line sequence within quoted strings. The limit on the length of lines, including any extensions using backslashes, is 4095 characters. Labels are symbols that represent addresses. The address given by a label is calculated during assembly. The assembler calculates the address of a label relative to the origin of the section where the label is defined. A reference to a label within the same section can use the PC plus or minus an offset. This is called program‑relative addressing. Addresses of labels in other sections are calculated at link time, when the linker has allocated specific locations in memory for each section. Local labels are a subclass of label. A local label begins with a number in the range 0‑99. Unlike other labels, a local label can be defined many times. Local labels are useful when you are generating labels with a macro. When the assembler finds a reference to a local label, it links it to a nearby instance of the local label. The scope of local labels is limited by the See Local labels for details of:
The first semicolon on a line marks the beginning of a comment, except where the semicolon appears inside a string constant. The end of the line is the end of the comment. A comment alone is a valid line. The assembler ignores all comments. Constants can be:
| ||||||||||||
| |||||||||||||