View Single Post
May 17th, 2013 (10:12 AM). Edited May 17th, 2013 by Kurapika.
Join Date: Feb 2013
Location: Lavendar Town - Morocco
Since I see people asking questions here, I have a problem using ldr with cmp. I am making a code that compares two words, one located in the RAM and the other located in the ROM. so what I do:
ldr r1, .word1 ldr r1, [r1] ldr r2, .word2 ldr r2, [r2] cmp r1, r2 beq YayTheyEqualz ...
The problem is, the jump never occurs even when the words are equal... So I tried this:
ldr r1, .word1 ldrh r1, [r1] ldr r2, .word2 ldrh r2, [r2] cmp r1, r2 beq SecondHalf ... SecondHalf: ldr r1, .word1 ldr r1, [r1, #0x2] ldr r2, .word2 ldrh r2, [r2, #0x2] cmp r1, r2 beq YayTheyEqualz ...
And this 2nd code works correctly but takes more space and it is more complicated. So, I'm wondering if ldr and/or cmr commands have some particular behaviour that makes the first code not working??? Or am I just doing something wrong?
My little Gen 3 tools project: G3T
Also Known As:
View Public Profile
Send a private message to Kurapika
Find all posts by Kurapika
Find threads started by Kurapika
Ignore Posts by Kurapika