As code is generated, it will be put into the next available location
in a static data area. A location counter
keeps track of the
next available location in the data area.
- Initially, the LC is set to 0 .
- After each instruction is generated, the LC is incremented
by the length of the instruction.
- When a label is encountered, the relative address of the label is
set to the value of the LC.
- At the end, the length of the code segment is the value of the LC.
There may be multiple location counters, e.g., one for code and one
for static data.