ARM Technical Support Knowledge Articles

GETTING DEFINED VALUE FROM THE COMMAND LINE

Applies to: A51 Macro Assembler

Answer


Information in this article applies to:


QUESTION

Using the A51 Assembler, I need to define a value via the command line. Is this possible?

ANSWER

No. The symbols you define on the command are defined with the SET keyword and it is not possible to use these as values for a DB or DW.

You may, however, use the #define directive and #include directive to define and include values from a C-style header file. For example, the following include file (ARGS.INC):

#define value 123

may be included in an assembly file.

#include "args.inc"

cseg at 30h

junk:   db      value

end

The resulting listing file shows the assembler output:


                       1     ;#include "args.inc"
                +1     2
                       3
                       4
----                   5     cseg at 30h
                       6
0030 7B                7     junk:   db      123
                       8
                       9     end

Another solution is to use multiple $IF statements to create constants that may be used in your assembler programs. For example:

$IF (VALUE = 230)
CURRENT_BOARD SET 230
$ELSEIF (VALUE = 220)
CURRENT_BOARD SET 220
$ELSEIF (VALUE = 212)
CURRENT_BOARD SET 212
$ELSE
__ERROR__ "Unrecognized value for VALUE in A51 command line."
CURRENT_BOARD SET 0
$ENDIF

SEE ALSO

Article last edited on: 2004-06-07 23:37:12

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