View previous topic :: View next topic |
Author |
Message |
mordax Expert Cheater
Reputation: 1
Joined: 16 Apr 2010 Posts: 138
|
Posted: Sun Sep 11, 2022 11:58 am Post subject: how can you compare 2 registers for same address? |
|
|
hello lords of the cheating world. I prey to you almighty lords.
i have a problem with compare (cmp) function. i have almost no experience in programming and coding and i ask for you cheat-gods to please provide me with full code.
i have 2 registers on same address and i would like to compare both of them and only then jump to my custom code.
for example:
Code: |
cmp R5,20
cmp R10,50
jne originalcode |
i know this is wrong as it does not help, but i have no knowldedge of how to make it work. i was told there is some failure and i should fix the code, but i don't know how. i'm here asking help from the cheat-gods who know it all.
all i need is for code to compare R5 to 20 and R10 to 50 and if both registers match, only then execute the custom code that comes below, otherwise jump to originalcode and skip custom code.
please fix my code for me and show me how is right way.
i was told i need another "jne" but where do i put it and where does it have to go?
i dont understand this. can someone please fix this part for me and show me what im doing wrong. thank you so much cheat gods. I hope to see your god-like working example.
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Sun Sep 11, 2022 2:22 pm Post subject: |
|
|
As mentioned previously in your other thread you have to use conditional instructions to determine logic of which code to execute.
Code: |
...
label(my_code)
newmem:
cmp r5,20
je my_code
jmp originalcode
my_code:
cmp r10,50
jne originalcode
// execute other code here
...
|
|
|
Back to top |
|
 |
mordax Expert Cheater
Reputation: 1
Joined: 16 Apr 2010 Posts: 138
|
Posted: Tue Sep 13, 2022 8:26 am Post subject: |
|
|
LeFiXER wrote: | As mentioned previously in your other thread you have to use conditional instructions to determine logic of which code to execute.
Code: |
...
label(my_code)
newmem:
cmp r5,20
je my_code
jmp originalcode
my_code:
cmp r10,50
jne originalcode
// execute other code here
...
|
|
thanks! this is exactly the kind of example I was looking for. i didn't understand where to jump and i was under the impression that two compares should be right next to eachother separated by just one jump.
edit: yes it works fine and now i fully understand why and how it works. i was basically right, i just didn't understand that i need to jump from label to label and its not possible to have 2 cmp under same label.
it's so much easier when people like you just give specific reply with no additional complications or nonsense added. +rep
however i didnt get my cheat to work as it seems like some other addresses still have same register values. i'm out of options now as there are only 2 registers that are static. rest are dynamic.
|
|
Back to top |
|
 |
|