Ok, I see what I did wrong here (duh!):
mfctr r0
andi. r0, r0, 0xF
cmpwi r0, 4
bne- default_instruction
ori r4, r4, 0x0000
default_instrction:
ori r4, r4, 0x0001
And understand what you did here:
ori r4, r4, 0x0001 #Default Instruction, bit 31 is set high
mfctr r0 #Grab address from CTR
andi. r0, r0, 0xF #Check last digit
cmpwi r0, 4 #Check last digit against value of 4
bne- end_code #If not equal, end code, we want bit 31 kept high
rlwinm r4, r4, 0, 0, 30 #Flip bit 31 low
end_code: #The end
Thanks for your critiques. I'm learning a lot from it.
I was just asking about the "rlwinm" instruction, and here, is a great example of how to use it.
mfctr r0
andi. r0, r0, 0xF
cmpwi r0, 4
bne- default_instruction
ori r4, r4, 0x0000
default_instrction:
ori r4, r4, 0x0001
And understand what you did here:
ori r4, r4, 0x0001 #Default Instruction, bit 31 is set high
mfctr r0 #Grab address from CTR
andi. r0, r0, 0xF #Check last digit
cmpwi r0, 4 #Check last digit against value of 4
bne- end_code #If not equal, end code, we want bit 31 kept high
rlwinm r4, r4, 0, 0, 30 #Flip bit 31 low
end_code: #The end
Thanks for your critiques. I'm learning a lot from it.
I was just asking about the "rlwinm" instruction, and here, is a great example of how to use it.