Hello evreybody,
I have met a confusiong issue while working with the RVMDK assembly: when I have written this statement:
ADD r1, r1, r2
It has been coded in Thumb2. But when I have changed the ADD instruction to ADDS, it become a Thumb instruction! Could any one explain to me why the add of the S, which indicates if the stauts register has to be modified or not, changes the mode in wich the instruction is coded.
Thanks to all
Hello,
Thank you for the links. This a code from the disassembly window of my RVMDK toolchain:
EB000102 ADD r1, r0, r2 1881 ADDS r1, r0, r2
You can remark that ADD r1, r0, r2 has been coded into 32bits, while ADDS r1, r0, r2 has been coded into 16bit.
Best regards Seif
Notice the difference
ADD R1, R1, R2 (this was your original statement)
and
Add R1, R0, R2
The first one will be encoded in 16-bit thumb-2 code
The second (as you have shown) will be encoded in 32-bit thumb-2 code.
Ok! Thanks a lot.
best regards Seif