I started out learning Thumb 2 , to program for the ARM Cortex M, and ended up buying a book on ARM
assembly language, cuz I assumed it would be the same instruction set, but this book uses the GAS Syntax for the GNU Assembler, which they say is different from ARM syntax works on a wide variety of architectures.
Of course, I have nothing against playing around with both instructions sets as I
fairly new to Assembly language, and would like to get a feel for changing environments
Which of course has me wondering about the Keil Assembler, and what instruction sets
it can support.
Is it just matter of choosing a different directive at the start, like instead a A THUMB directive, it would be GAS or GNU or GNU ARM
or whichever the directive is fir instruction sets that Keil supports?
And is there is list somewhere of which instruction sets Keil supports?
The one specified in the manual?
http://www.keil.com/support/man_arm.htm
I get directory not found when i click that link
I'll try again:
EDIT
Nope - still not working.
But you can easily find it from the Keil homepage:
Yeah, i was trying to send another comment earlier too. I had already found the manual and had said they spoke of ARM, THUMB, and THUMBEE but it didnt say anything about GNU ARM.
I eventually gave up on trying to send my comment.
Something not working
But, i am still unclear from what it says in the manual.
Am i to assume tbose are the only three instruction sets KEIL supports?
GNU is an entirely separate, independent thing:
https://en.wikipedia.org/wiki/GNU
The ARM and GNU assemblers are not the same.
https://developer.arm.com/docs/dui0773/f/assembling-assembly-code/assembling-arm-and-gnu-syntax-assembly-code
Damn. I was hoping thefe was a way i could use the same syntax in Keil. So if I wanted to program my cortex M with GNU ARM , i would need a different IDE than keil? Or would i have to do it all from command prompt?
There is GNU, then there is ARM, then there is GNU ARM. So i guess you can use GAS to assemble ARM, but you can’t use keil to assemble GNU ARM?
Here, a picture is quicker.
The Keil IDE is called uVision.
uVision can work 3rd-party tools - though I'm not sure why you'd want to do that?
The obvious choice for an IDE for use with GNU tools would be Eclipse
Because those are the two environments im learning right now, so i wanted to see if i could kill two birds with one stone. But I will check out eclipse. Thanks. I will mark as resolved.
You're totally mixing up two separate issues there.
One is the choice of assembler syntax. That is between Unix (as in GAS) and ARM native syntax.
The other is between instruction sets. That is between ARM, Thumb, Thumb II and what not.
Those two have essentially no relationship with each other.
Oh, ok. That actually makes sense then. So when they speak of GNU ARM, they are speaking of the ARM instruction set written in GNU syntax? The syntax is going to depend on the assembler i use, and the instruction. set is going to depend on the processor? So, I guess the book I am learning GNU Arm in , will only be good with a GAS assembler? I guess i just thought of Keil being an IDE that would let me choose a syntax. (Despite assuming the syntax was based on the instruction set.)They said GAS worked with a wide variety of architecture, so i guess was hoping Keil did too. So I Guess what i am wanting to be able to do is covert the syntax.
i have been using Thumb 2. But i guess if i learn to use the instruction set in Keil, then read my book ib GNU ARM, it probably wouldn’t be a huge stretch to convert syntax.
Would just have to know all the things, like switch the order of the source register and destinatiin register when it applies, or whatever the syntax differences will be. But will still use same instructiin set
You understand the difference between source code and machine code?
yeh, understand that much. But it’s gonna be up to the assembler in what syntax it understands. I just wanted to know what the keil assembler was capable of. If the Gas assembler works with many architectures i was hoping tgat Keil would too (before i assumed that the syntax difference was due the instructiin set)
. Ultimately, I was hoping i could learn how to use the gas syntax in keil.
To make use of the book
But i am beginning
to think this book is gonna require me to use a different IDE
seth said:it’s gonna be up to the assembler in what syntax it understands
Of course!
Because the source code is the input to the assembler - so it must have the syntax that the assembler accepts!
seth said:If the Gas assembler works with many architectures i was hoping tgat Keil would to
But the target architectures define the machine code - not the source!
seth said:use the gas syntax in keil
Keil is just a company.
Again, the Keil IDE is called uVision.
By default, uVision uses the ARM toolchain - but it can also work with GNU