ARM Technical Support Knowledge Articles

ACCESSING SPECIFIC BYTES OF AN EXPRESSION

Applies to: A166 Macro Assembler

Answer


Information in this article applies to:


QUESTION

Using assembly, I need to access the individual bytes of an address in assembly. I have created the following code:

DB  LOW(SEG variable), HIGH(SEG variable)
DB  LOW(SOF variable), HIGH(SOF variable)

However, when I assemble this, I receive the following error message:

*** ERROR #A70: INVALID TYPE OF EXPRESSION

ANSWER

Use the BYTE0-BYTE7 prefixes to access specific bytes of an expression. The following code will do what you expect:

DB  BYTE2(variable), BYTE3(variable)
DB  BYTE0(variable), BYTE1(variable)

Article last edited on: 2002-01-29 00:00:00

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