currently working on reverse engineering some MIPS assembly and I am a bit stuck
004052c0 <subroutine_fnc>:
4052c0: 27bdfff8 addiu sp,sp,-8
4052c4: afbe0004 sw s8,4(sp)
4052c8: 03a0f025 move s8,sp
4052cc: afc40008 sw a0,8(s8)
4052d0: 8fc20008 lw v0,8(s8)
4052d4: 00000000 nop
4052d8: 2842005b slti v0,v0,91
4052dc: 10400006 beqz v0,4052f8 <subroutine_fnc+0x38>
4052e0: 00000000 nop
4052e4: 8fc20008 lw v0,8(s8)
4052e8: 00000000 nop
4052ec: 28420041 slti v0,v0,65
4052f0: 10400004 beqz v0,405304 <subroutine_fnc+0x44>
4052f4: 00000000 nop
else
4052f8: 8fc20008 lw v0,8(s8)
4052fc: 1000000c b 405330 <subroutine_fnc+0x70>
405300: 00000000 nop
405304: 3c020041 lui v0,0x41
405308: 8c426190 lw v0,24976(v0)
40530c: 00000000 nop
405310: 24430001 addiu v1,v0,1
405314: 3c020041 lui v0,0x41
405318: ac436190 sw v1,24976(v0)
40531c: 8fc20008 lw v0,8(s8)
405320: 00000000 nop
405324: 24420020 addiu v0,v0,32
405328: afc20008 sw v0,8(s8)
40532c: 8fc20008 lw v0,8(s8)
405330: 03c0e825 move sp,s8
405334: 8fbe0004 lw s8,4(sp)
405338: 27bd0008 addiu sp,sp,8
40533c: 03e00008 jr ra
405340: 00000000 nop
I think I have been able to disassemble most of it but I am really stuck on halfway through where the else statement. I mainly don't really understand the instructions lw v0,24976(v0)
and lui v0,0x41
too well. Any help would be greately appreciated.
int subroutine_fnc(char a) {
int b = (a<91) ? 1 : 0;
if(b==0){
return a;
}else{
b = (a<65) ? 1 : 0;
if(b != 0){
return a;
}else{
b = 0x41 << 16;
//int v1 = b+1;
// ???
a+=32;
}
}
return a;
}