Re: ARM assembler: labels



"Roman Mashak" <mrv@xxxxxxxx> writes:
Hello, Paul!
You wrote on Mon, 25 Aug 2008 11:42:18 +0300:

PK> Typically label1 and label2 would be descriptive names.

PK> Look at the code where you have the branch/jump instruction to
PK> label1/label2 and there are typically different reasons to going to
PK> either label1 or label2.

This is snippet from the "AT91sam7s getting started" startup code by Atmel:

[skip includes and defines]

/* Application startup entry point */
..globl reset_handler
..align 4

..section .vectors
..arm

/* Exception vectors (should be a branch to be detected as a valid code by
the rom */
_exception_vectors:
reset_vector:
ldr pc, =reset_handler
undef_vector:
b undef_vector /* Undefined Instruction */
......

'_exception_vectors' is not referred anywhere else in the code. I was asking
about such situations. Perhaps Atmel guys writing this code just forgot to
erase old label or they might have left it deliberately for some reason.

No harm, no foul as they say in the NBA. Disassembled code
produced by compilers quite regularly include numerous
labels that are never referenced. It is quicker and
easier to include unreferenced labels than to spend a
lot of logic deciding which ones are active and which
ones aren't. One compiler with which I regularly work
inserts a line for every source line, including null
statements.

PK> For instance, if instruction1/2 are part of a common error handler, it
PK> is practical to list the name of each error contrition with different
PK> label names, although the error handler code is common.
.



Relevant Pages

  • Re: ARM assembler: labels
    ... PK> Typically label1 and label2 would be descriptive names. ... PK> Look at the code where you have the branch/jump instruction to ... although the error handler code is common. ...
    (comp.arch.embedded)
  • mod function
    ... I am trying to get label2 to divided enely into label1. ... 'Checks all of the conditions for the number to be placed in the label box ... Randomize() ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Autosizing and column spanning conundrum
    ... If I set the column span of both the label1 and the label created at run ... I set the BackColor of the label1 to the ... TableLayoutPanel and the new Label named label2. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.csharp)
  • Modeling the condition code register in register allocation
    ... model the condition code register properly. ... IF d GOTO label1 ELSE GOTO label2 ... e' -> %rsi ...
    (comp.compilers)
  • RE: ITemplate - Dynamic ImageButton in BindLabelColumn for DataLis
    ... Label1 is the id of the label that I placed within the ... DataList markup. ... You have to give the label an Id to be able to identify it ... > Thanks, Erik ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)