single ARM instruction to copy C into r0 ?

Correct, this is the standard assumption of C/C++, eg. int arr[100] implies that &arr[100] != NULL. Many compilers and in particular loop optimizers use stronger assumptions than that to allow prefetching and other advanced loop transformations. All this is considered safe, especially since the first and last 4KB are typically reserved by the OS.

Yes, architecture 5 made interworking much simpler so you don't need veneers or special return sequences anymore.

Yes, this is good for codesize. Good compilers even use STM to create a small amount of stack:

PUSH {r0-r2, r4, lr} ; push r4, lr and create 12 bytes of stack space ... POP {r1-r3, r4, pc} ; remove 12 bytes of stack, restore r4,lr and return r0

High-end ARMs typically transfer 2 registers per cycle and may execute other instructions in parallel, so it doesn't cost much performance.

Yes... No there is no relation, but I dislike goto's as well!

Wilco

Reply to
Wilco Dijkstra
Loading thread data ...

= 0

[snip]

Errm, am I missing something - you mentioned ARM922T, which is ARM9TDMI core and according to the manual it's ARM Architecture v4T. Or are you just talking about a different target you're working on?

[snip]

:-))

Reply to
tum_

C = 0

Thanks tum_ for pointing that self-contradiction. Indeed my current target uses an ARM922T core, I can't figure out why I assumed architecture version 5, and it looks like POP {pc} will not return to Thumb mode if needed :-(

Francois Grieu

Reply to
Francois Grieu

X, C = 0

arithmetic)

pointer

And thanks to Wilco Dijkstra for mentioning the 'new UAL syntax', I've never heard about it before and learned something new. DUI 0204F (from the ARM site) explains things quite well. (Unfortunately, I don't have the luxury of choosing development tools, I'm stuck with gcc).

Reply to
tum_

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.