(06-30-2021, 07:15 PM)JimmyKazakhstan Wrote: Sorry man, but I just feel that using the first few registers makes for an easier example, If it bothers you that much, I'll add a big warning on the page that's impossible to miss saying not to use any of the registers in the examples.
For me, It actually takes a bit longer if an example is laid out like "r14, r2, r8" for me to understand it, It's just all over the place. I just feel that using the first 3 is a better way to go about it, It's hard for me to explain, but I'm sure a least 1 other person feels the same way. I just think it would just make for easier learning. I can't explain it in detail but you probably get what I'm trying to say.
No worries at all and there's no need to apologize. At the end of the day, it's your guide.
(06-30-2021, 07:15 PM)JimmyKazakhstan Wrote: Please don't take any type of offense to this. But a lot of the time some of the tutorials posted have very v.a.g.u.e and technical wording, I know it makes perfect sense to you, but I barely even know what any of it means. Stack frames seem like one of those things that have to be explained using very specific details, but I'm learning how they work first.
No offense taken. Regarding the stack frame stuff, you can just utilize the version that backs up r14 thru 31, and you can let your readers know to use that specific stack example for their codes.
(06-30-2021, 07:15 PM)JimmyKazakhstan Wrote: I don't know, maybe it's just me, I can't really learn anything complicated unless it's explained in full detail to me, but I know that at least one other person has the same issue, which is mostly why I made the guide.
I believe my tutorials have enough details, in fact I think I baby step them a little too much. However my tutorials lack screenshots and visual documentation. If I get time, I can add a bunch of pics, diagrams, screenshots, etc. I just worry that new comers will skim the threads go right to the pics and try to 'copy paste' instructions/sources into addresses randomly instead of actually reading and digesting the info as ASM is not an 'exact science' and every situation with every code is different.
(06-30-2021, 07:15 PM)JimmyKazakhstan Wrote: What are the other uses it has though? Are you talking about the extended mnemonics like ori, andi, etc.?
Yes.
Check out one of Seeky's first codes - https://mkwii.com/showthread.php?tid=1389
View the source on that and you can see he does an ori instruction to flip a hit high and a rlwinm instruction to flip a bit low (rlwinm can 'mimic' ANDing'). Some values in games won't be in bytes, halfwords, or words, but they will be represented by bits. Thus the only way you can modify these bits correctly is by Logical Operations.
Also, I saw this on your guide~
(06-30-2021, 07:15 PM)JimmyKazakhstan Wrote: This will load address 0x8000FFFF into register 0
You might be thinking "why not just use li for the bottom half of the register?"
"li" can only load values up to 0x7FFF into a register, whereas "ori" can load values up to 0xFFFF
Anytime li (load immediate) is executed, the upper 16 bits of a register is set to 0x0000, unless you are placing in a negative value (.i.e li r4, 0xFFFFFFFC which can also be written as li r4, -4)
Ori is used to complete the lower 16 bits as it's easier than using addi, cause addi uses signed values, and you can't use addi to write a word value from scratch to a register if it's register 0 cause of the literal 0 rule.
Examples:
lis r4, 0x8000
addi r4, r4, 0x1500 #Sets r4 to 0x80001500 just like how ori will
--
Fill r4 as 0x8000A000 w/o using ori
lis r4, 0x8001 #Increase lis value by 1
addi r4, r4, 0xFFFFA000 #Do the sign extend trick
--
lis r0, 0x8000
addi r0, r0, 0x1500 #Won't work as r0 will end up just being 0x00001500; fyi this addi instruction is the same thing as li r0, 0x1500