ARM Technical Support Knowledge Articles

ADS 1.1 armasm: Error: A1140E: Bad operand type

Applies to: ARM Developer Suite (ADS)

Answer

In ADS 1.1, assembler code of the form:

    AREA foo, CODE
label1 NOP
label2 NOP
       DCD (label2-label1):AND:0xFF
END

incorrectly results in the error:

Error: A1140E: Bad operand type 

This occurs where the difference between two labels is being calculated together with some other operation (AND in this case).

This is a regression from ADS 1.0.1.

This is fixed in ADS 1.2 The workaround for ADS 1.1 in this case is to introduce a intermediate EQU symbol, e.g:

   AREA foo, CODE
label1 NOP
label2 NOP
diff   EQU (label2-label1):AND:0xFF
DCD diff
END

This problem can also occur with instructions of the form:

    ADD r0,r0,#(label2-label1):AND:0xFF 

The same workaround can be applied:

diff   EQU (label2-label1):AND:0xFF
ADD r0,r0,#diff

Article last edited on: 2008-09-09 15:47:28

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential