The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+9 votes
The purpose of instruction location counter in an assembler is _______
asked in Compiler Design by Veteran (59.8k points) | 692 views

The purpose of instruction location counter in an assembler is _______

I think for Back patching related work.

Refer ->

1 Answer

+6 votes
Each section of an assembler language program has a location counter used to assign storage addresses to your program's statements. As the instructions of a source module are being assembled, the location counter keeps track of the current location in storage.
answered by Active (2k points)
What is the use of assigning storage location to each statement?
Labelled jumps maybe.
In intermediate code generation stage of a compiler we often need to execute "jump" instructions to places in the code that don't exist yet. To deal with this type of cases a target label is inserted for that instruction. A marker nonterminal in the production rule causes the semantic action to pick up.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,068 questions
53,206 answers
70,419 users