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?
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