Pseudo-Instructions
DC (#)op1[ (#)op2]- Opcode: N/A
- Addresses: 1 for each operand
- Flags: none
- Registers: none
- Function: Insert raw data
Indicates a literal data block. The DC instruction will not be actually compiled. Instead each of its operands will be stored in memory as-is, one at each of the following memory addresses. For example, DC #0x2D90 #0xF656 will simply write the values 0x2D90 and 0xF656 at the next two memory addresses. The DC pseudo-instruction can not take more than two operands. DC pseudo-instructions with labels are a common way to reserve memory space for initialized variables.
You should take care to avoid literal data blocks being accidentally executed, since the microncontroller will treat the value at the corresponding memory address as a normal opcode and try to execute it, with unpredictable results. You could, of course, intentionally use valid opcodes in the literal data block and then purposefully execute them, though there is no advantadge to doing so instead of using assembly language mnemonics.
DS (#)op1- Opcode: N/A
- Addresses: as many as value of op1
- Flags: none
- Registers: none
- Function: Reserves empty space
Reserves the next op1 memory addresses as empty storage space. The DS pseudo-instruction is not compiled. Instead, the assembler skips as many memory addresses as the value of op1, and continues compilation at the next memory address. DS pseudo-instructions with labels are a common way to reserve memory space for uninitialized variables.
EQU (#)op1- Opcode: N/A
- Addresses: none
- Flags: none
- Registers: none
- Function: Equates a symbolic name to a numeric value
The EQU pseudo-instruction simply equates a symbolic name (the label) to a numeric value (the operand). The assembler substitutes the value of op1 for the symbolic name of the instruction's label. If the instruction is present without a label, it does nothing. Bear in mind that the pseudo-instruction will not be compiled into an opcode, and that using the pseudo-instruction's label will reference the instruction's operand's value, not it's memory address. Thus, unlike other labels, EQU'd labels must be provided with an addressing mode when used as operands.
ORG (&)op1- Opcode: N/A
- Addresses: none
- Flags: none
- Registers: none
- Function: Changes memory address where program will be loaded
Specifies the memory address where the following instructions should be written to. The instruction following the ORG pseudo-instruction will be stored in memory address op1, and the rest of the program will be stored sequentially from there, unless another ORG pseudo-instruction is found. Note that a label on a ORG pseudo-instruction will reference the memory address of the next proper instruction.
label:- Opcode: N/A
- Addresses: none
- Flags: none
- Registers: none
- Function: Label memory address
A label is used as a mnemonic to mark a specific memory address. The name of the label must precede the actual instruction, it must start with a letter, it must only contain letters and numbers and it must end with a colon (:). Labels are not actually compiled. Instead, the compiler will substitute any reference to a label in your code with the actual number representing the memory address of the instruction where the label is. Labels must not be longer than 8 characters.