Thread: [Tutorial] HackMew's Knowledge
View Single Post
  #115    
Old May 17th, 2013 (03:30 PM).
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by Kurapika:
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:
Spoiler:
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:
Spoiler:
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?
Would you mind giving us all of the ASM in the regular format? It is really tough the read this way.
__________________

Paired with Simba
Reply With Quote