We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Excuse me for asking such a simple question, but assumed you want to test a memory location, say, a 16 bit word in memory address "location"
for 0, what would be the appropriate instructions? easiest, most elegant, shortest, fastest?
ldr r4,=location
ldr r0,[r4]
cmp r0,#0
bne 1f
do sth....
1: continue
The " ldr r0,[r4]" is loading a 32-bit word, not 16-bit halfword. In case that matters, you could replace it with " ldrh r0,[r4]".And the CMP and BNE you can combine into a CBZ or CBNZ: Arm A-profile A32/T32 Instruction Set Architecture