Keil™, An ARM® Company

Technical Support

A166: ACCESSING SPECIFIC BYTES OF AN EXPRESSION


Information in this article applies to:

  • A166 Version 4.20

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)

Last Reviewed: Tuesday, January 29, 2002


Did this article provide the answer you needed?
 
Yes
No
Not Sure