Codes
WiiRd forum
March 29, 2024, 12:02:53 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome on the new server

Update 4.3 - do NOT update!
Gecko 1.9.3.1
Should I get a USB Gecko, I wanna hack?
How do I use my USB Gecko
Where can I get WiiRd?
 
   Home   CODE DATABASE GAMEHACKING Help Search Login Register  
Pages: [1]
  Print  
Author Topic: cmpwi; blt: Clarification needed  (Read 1990 times)
CosmoCortney
Hacker
Jr. Member
*****

Karma: 8
Posts: 85

Mensch-Maschine, halb Wesen & halb Ding


WWW
« on: June 13, 2015, 04:26:14 AM »

Hi,
I'm have made an assembly code to permanently store a value if another value is smaller than 0xA00.
If it is greater than 0XA00 another (default) value is written.

The problem is that the comparison does not seem to be working properly.

Code:
.
.
.
lis r8, 0x803D /* load address of the growing
ori r8, r8, 0x1F48    integer into r8 */
lwz r10, 0 (r8) // load growing Int from address in r8 (803D1F48) into r10
lis r8, 0x804C /* load address
ori r8, r8, 0xB4EC    i want to write at */
cmpwi cr7, r10, 0xA00   // Compare r10 with 0xA00 ?
blt- 0x800035A4 // goto 800035A4 if r10 is lower than 0xA00 ?
lis r9, 0x3B40
.
.
.


when r10 is lower than 0xa00 the execution does not jump to 800035A4.
Any idea what's wrong here?
Logged

wiiztec
Lazy hacking machine
Hacker
Hero Member
*****

Karma: 34
Posts: 813

TimmyKitty7124
WWW
« Reply #1 on: June 14, 2015, 01:56:33 PM »

You need to use the same condition register as the compare for the branch.
so blt- cr7,0x800035A4
Logged

If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen
CosmoCortney
Hacker
Jr. Member
*****

Karma: 8
Posts: 85

Mensch-Maschine, halb Wesen & halb Ding


WWW
« Reply #2 on: June 15, 2015, 05:16:51 PM »

You need to use the same condition register as the compare for the branch.
so blt- cr7,0x800035A4


Already tried that. But nothing happened. Removing "cr7" from the syntax solved the problem
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!