First page Back Continue Last page Overview Graphics
The location counter keeps track of the next available memory location that can be assigned within the current segment., e.g. code, or data.
The location counter starts at zero by default and increments by one with each byte of memory allocated.
The org assembler directive can be used to start the location counter at a particular offset address.
When assembling a three byte instruction, the location counter will increment by three bytes to accommodate the memory needed for the instruction. Separate location counters are used for different sections of the program. Typically one section is used for code and another for data. Actual locations are fixed during the linking process.
The following statement forces the location counter to start at offset address 10 hexadecimal.
An ORG is typically not needed since the linker will fix final addresses.