#17123 - poslundc - Mon Mar 01, 2004 10:01 pm
.hword vs .short?
.word vs .int vs. .long?
.code16/.code32 vs. .thumb/.arm?
etc.
They all mean the same thing to the assembler, but is there a better or worse one to use in terms of portability or naming conventions?
Dan.
#20155 - pan69 - Mon May 03, 2004 7:48 am
Hi,
I'm not quite sure and I think it doesn't realy matter in assembler. For instance, on a x86 machine there are no halfwords, there they are called words, but since you can't port ARM code to x86 it doesn't matter. I use hword because it's name is more native to the CPU.
Again, and this is usually only for C/C++ compilers. An INT can be different on different types of machines. An INT can be 16 or 32 bits in width, usualy it depends on de hardware and the compiler building for this hardware. So if you want to make sure you are using 32 bits, use LONG.
The ARM vs. Thumb speaks quite for it's self (hence the 16 and 32 in the name). Every Thumb code instruction takes up 16 bits where every ARM code instruction takes up 32 bits. ARM code if usually faster, but has as you can understand it has a higher code desity (read is larger). Use can however intermix Thumb and ARM code. This way you can compile you normal program flow code to Thumb and your super fast triangle-poly-pixel-pump routine in ARM code.
- Pan