Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Arm Development Studio forum
ARM Vs GCC assembler
Jump...
Cancel
Locked
Locked
Replies
13 replies
Subscribers
118 subscribers
Views
9701 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
ARM Vs GCC assembler
Gerald Murphy
over 10 years ago
Note: This was originally posted on 25th January 2013 at
http://forums.arm.com
Hi,
I have a question regarding the ARM and GCC assemblers i.e. ARMASM and GAS.
MOV.W R4,#0x87C0 is translated to F248_74C0 by ARMASM.
However, GAS throws up the error "invalid constant (87c0) after fixup" for the same instruction. Why does GAS give an error for this?
I realise the operand is 16-bit but I'm using the '.syntax unified'. I thought GAS supports .W and .N suffixes. Even without the .W suffix, GAS gives the same error whereas ARMASM quietly expands the 16-bit instruction to 32-bit.
I'm using 'GCC version 4.7.2 (Sourcety CodeBench Lite 2012.09-63).
Any insight as to why GAS is giving an error is appreciated. The workaround is to use two instructions. The following 2 instructions compile OK.
MOVW R4 ,#0xC0
MOVT R4 ,#0x87
Thanks and regards,
Ger
Parents
Gerald Murphy
over 10 years ago
Note: This was originally posted on 1st February 2013 at
http://forums.arm.com
Thanks for the reply Scott.
Just one comment, the ARM V7 Thumb2 instruction set inlcudes a MOV.W encoding option (in addition to the MOVW encoding). ARMASM recognises MOV.W.
According to the GNU assembler documentation provided by Sourcery CodeBenchLite 2012.09-63, use of the ".syntax unified" directive means that the .N and .W suffixes are recognised and honored.
However, when using GAS assembler, the instruction "MOV.W R4,#0x87C0" gives "error: invalid constant (87c0) after fixup". I've included the ".syntax unified" directive at the beginning of the source code.
So the question is: does GAS support the .W suffix for MOV? It seems not but maybe I'm missing something?
regards,
Ger
Cancel
Up
0
Down
Cancel
Reply
Gerald Murphy
over 10 years ago
Note: This was originally posted on 1st February 2013 at
http://forums.arm.com
Thanks for the reply Scott.
Just one comment, the ARM V7 Thumb2 instruction set inlcudes a MOV.W encoding option (in addition to the MOVW encoding). ARMASM recognises MOV.W.
According to the GNU assembler documentation provided by Sourcery CodeBenchLite 2012.09-63, use of the ".syntax unified" directive means that the .N and .W suffixes are recognised and honored.
However, when using GAS assembler, the instruction "MOV.W R4,#0x87C0" gives "error: invalid constant (87c0) after fixup". I've included the ".syntax unified" directive at the beginning of the source code.
So the question is: does GAS support the .W suffix for MOV? It seems not but maybe I'm missing something?
regards,
Ger
Cancel
Up
0
Down
Cancel
Children
No data