ARM Technical Support Knowledge Articles

USING DRK REGISTERS WITH IMMEDIATE VALUES

Applies to: A251 Macro Assembler

Answer


Information in this article applies to:


SYMPTOMS

I can't seem to move or compare 32-bit immediate values with a double register (DR0, DR4, etc.). What's going on?

CAUSE

The 251 supports the MOV and the CMP instructions for double registers and sign-extended 16-bit values. 32-bit values are not supported.

RESOLUTION

The A251 manual is misleading in its description of the syntax of these instructions. The following is a small example assembly file that demonstrates the use of each of the four instructions:

CSEG    AT      0

CMP DR0, #00001234H   ; Compare DR0 with 0x00001234 (zero extended data)
CMP DR0, #0FFFF1234H   ; Compare DR0 with 0xFFFF1234 (one extended data)


MOV DR4, #00001234H   ; Move 0x00001234 into DR4 (zero extended data)
MOV DR4, #0FFFF1234H   ; Move 0xFFFF1234 into DR4 (one extended data)

END

When assembled, this gives the following output.

000000                    1     CSEG    AT      0
                          2
                          3
000000 BE081234           4             CMP DR0, #00001234H
000004 BE0C1234           5             CMP DR0, #0FFFF1234H
                          6
                          7
000008 7E181234           8             MOV DR4, #00001234H
00000C 7E1C1234           9             MOV DR4, #0FFFF1234H
                         10
                         11
                         12     END
                         13

Looking at the opcodes and operands generated you can see that the initial '0000' or 'FFFF' (extended data) is only used to distinguish between two different opcodes, and the data used is actually only 1234H.

Article last edited on: 2005-06-12 11:49:56

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