jump to label

Ashwin Pathmudi ashwin.pathmudi@gmail.com
Wed Feb 7 12:08:00 GMT 2007


Hi,

On 2/7/07, Efim Monyak <ymonyak@lipowsky.de> wrote:
> Hi,
>
> I have seen in the assembler sources jumps to numerical labels.
> i.e.
> 1:
> beq 1b
> ...
> 1:
> beq 1b
>
> or
> beq 99f
> 99:
>
> the as description says:
> 5.1 Labels
> A label is written as a symbol immediately followed by a colon `:'. The
> symbol then represents the current value of the active location counter,
> and is, for example, a suitable instruction operand. You are warned if
> you use the same symbol to represent two different locations: the first
> definition overrides any other definitions.
> [snip]
>
> I don't found the description of this syntax, what does 'b' or 'f' mean?
> Is this a specific label type?

'b' and 'f'  probably stand for back and forward.
 So in  a case say

1:
    ...
    beq 1b
    ...
1:

the branch will happen to the first '1' label going backwards from the branch
instruction
and in a case like

2:
   ...
   beq 2f
   ...
2:

it will branch to the the first '2' label going in the forward direction.

HTH,
cheers,
Ashwin Pathmudi.



More information about the Binutils mailing list