Copy Byte Data (20 Bytes)
Jump to navigation
Jump to search
# ROUTINE: COPY BYTE DATA (20 BYTES) # This routine is often used to copy the Used Action data (0x16e - 0x181 of unit data). # Maybe this routine is just for copying that struct, but this is a very generic way of doing it... # Parameters: # r4 = Source pointer # r5 = Destination pointer 0005e22c: 00001821 addu r3,r0,r0 # index = 0 # do { 0005e230: 90820000 lbu r2,0x0000(r4) # value = *sourcePointer 0005e234: 24840001 addiu r4,r4,0x0001 # sourcePointer = sourcePointer + 1 0005e238: 24630001 addiu r3,r3,0x0001 # index = index + 1 0005e23c: a0a20000 sb r2,0x0000(r5) # *targetPointer = value 0005e240: 2c620014 sltiu r2,r3,0x0014 0005e244: 1440fffa bne r2,r0,0x0005e230 0005e248: 24a50001 addiu r5,r5,0x0001 # targetPointer = targetPointer + 1 # } while (index < 20) 0005e24c: 03e00008 jr r31 0005e250: 00000000 nop