I am targeting a Cortex-M0 processor, and am new to Thumb assembly available on the M0. Is there more efficient way to swap two bytes in a 32-bit word (in this example, the middle two bytes)? Thanks!
LDR R0, =0xAABBCCDD LDR R1, =0x00FF0000 LDR R2, =0x0000FF00 MOV R3, R0 MOV R4, R0 ANDS R3, R1 ANDS R4, R2 BICS R0, R1 BICS R0, R2 LSRS R3, #8 LSLS R4, #8 ORRS R0, R3 ORRS R0, R4
LDR R0, =0xAABBCCDD
LDR R1, =0x00FF0000
LDR R2, =0x0000FF00
MOV R3, R0
MOV R4, R0
ANDS R3, R1
ANDS R4, R2
BICS R0, R1
BICS R0, R2
LSRS R3, #8
LSLS R4, #8
ORRS R0, R3
ORRS R0, R4
42Bastian Schick said:I can always recommend this book ... Edit:www.sciencedirect.com/.../the-definitive-guide-to-the-arm-cortex-m0
I can always recommend this book ...
Edit:www.sciencedirect.com/.../the-definitive-guide-to-the-arm-cortex-m0
Absolutely!
See also: http://www.keil.com/books/
specifically: http://www.keil.com/books/armbooks.asp
Thank you for that link! Will check out the books there.