ARM Technical Support Knowledge Articles

GETTING ALIGNMENT WARNING A134 ON ASSEMBLY

Applies to: A166 Macro Assembler

Answer


Information in this article applies to:


SYMPTOM

I'm trying to assemble a file for a C167x device using A166 assembler and on the following statement:

      MOV    0EF27H,ONES

I get the warning:

A134: ADDRESS ALIGNMENT NOT SUFFICIENT

I can't find this error in the documentation. What does it mean?

CAUSE

The A134 message you see is a warning that you are trying to move a 16-bit word to an odd-byte address, specifically 0xEF27. If you attempt to run this code on a C167x device the chip will execute a hardware trap. The A166 assembler knows this will happen and generates the warning for you.

RESOLUTION

If your intent is to move only 1 byte, use MOVB instead of MOV. For example,

    MOVB    0EF27H,ONES  ; Moves the low byte of ONES to odd-byte address 0EF27H

If you really want to move a word to an address that starts on an odd-byte boundary there are a number of ways to do this. Here's one:

      PUSH    R1              ; Save reg
      MOV     R1,ONES         ; Read the source word
      MOVB    ERDAT0,RL1      ; Store the odd byte
      MOVB    ERDAT0+1,RH1    ; Store the even byte
      POP     R1              ; Restore reg

MORE INFORMATION

SEE ALSO

Article last edited on: 2007-01-18 14:52:06

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