I'm taking a look on ARM Assembly for my new project that I'm in(port my own Linux distro to a Integrator-CP, that uses ARM). For this I'm reading the book ARM System Developer's Guide: Designing and Optimizing System Software, but I'm also reading some articles over the internet, and as the ARM land is a place that C/C++ rules, because Assembly is a kind of human impossible, then on the tutorials of ARM Assembly, they usually show C/C++ code and then the equivalent in Assembly(commented line-by-line with the corresponding C/C++ line), then I saw this:
ldr r0, [r1, r2] @ Pre-indexed. r0= *(u32*)(r1+r2) ldr r0, [r1, r2]! @ Pre-indexed, writeback. r0= *(u32*)(r1 += r2) ldr r0, [r1], r2 @ Post-indexed, writeback. r0= *(u32*)r1; r1 += r2;
Then this questions pop-uped on my mind:
- What is the += operator?
- What is the use of that operator?
- Why not just =, or just +?
Note that r0, r1 and r2, are ARM registers.
Nathan Paulino Campos
This post has been edited by nathanpc: 26 June 2010 - 02:33 PM