So I´d like to know how I could achieve all this using code types.
Let´s pretend that I wanted to search the string "Bully".
We would probably write this F6 Code:
F6000001 80008100
42756C6C 79000000 -> Bully in HEX
now we want to grab the address of our first letter, let´s say it´s 80123456.
We then want to search for that value using another F6 code type.
F6000001 80008100
80123456 00000000 -> search for value 80123456
14000004 98765432 -> Finally, we´ll write our new value shifted 4 bytes right
So yeah, how can I fill in the middle part where it "grabs" the address of our "B" from memory without putting a specific address?
I think this should work as described:
F6000001 80008100
42756C6C 79000000 -> Bully in HEX
90010007 00000000 -> set gr7 = po, so gr7 contains 80123456
4E000010 00000000 -> set po to "80123456"'s address in the 3rd line below
94210007 00000000 -> store gr7 to po
F6000001 80008100
80123456 00000000 -> search for value 80123456
14000004 98765432 -> Finally, we´ll write our new value shifted 4 bytes right
This was what I was about to say, however F6 searches in 8 byte chunks if I'm not mistaken. And I think you want to search for just the address in memory which is 4 bytes. What would we fill in the next 4 bytes with? Cuz F6 might never find [address] 00000000.
Ah, you're right, the NN in the code is supposed to be the # of lines...
F60000NN XXXXYYYY
ZZZZZZZZ ZZZZZZZZ
ZZZZZZZZ ZZZZZZZZ
Firstly, thx for your answers ;D
Since I just put 00000000 for the second search part, it will probably fail.
But in any case I will be able to put the correct value for it. Let´s say it´s 0000000F.
Would this work?
[spoiler]F6000001 80008100
42756C6C 79000000 # let´s say that this can be found in memory (including the 000000 part)
90010007 00000000
4E000010 00000000 # store result below
94210007 00000000
F6000001 80008100
XXXXXXXX 0000000F # will be written using the result above
14000004 98765432
E0000000 80008000[/spoiler]
Since it seems to be confusing, here´s what I´m trying to achive in other words:
Firstly, I wanna search a specific string in memory.
Once it has been found, I want to grab the address where my string begins.
Secondly, I wanna search that address considered as it would be a value.
When that has been found, I just want to do a RAM Write there. :P
Yeah, that blue line is pointing to the beginning of the blue "XXXXXXXX", so "XXXXXXXX" will be overwritten if the first search is successful. But as Stuff said, the "F6000001" will search the whole 8 bytes below it...
Quote from: daijoda on November 25, 2011, 04:42:04 PM
Yeah, that blue line is pointing to the beginning of the blue "XXXXXXXX", so "XXXXXXXX" will be overwritten if the first search is successful. But as Stuff said, the "F6000001" will search the whole 8 bytes below it...
... that´s everything I needed to know. :p
It seems like it´s useless, it is quite useless.
But it´s a cool hacking method. ;D