Store X into Y

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Parameters : r4 = Origin Data Pointer                 rq : redundant with Store_X_Byte_into_Y
             r5 = Destination Data Pointer
             r6 = Data size (number of bytes)

This routine Load Data from r4 and Store it in r5  (r6 = number of byte - one loop iteration per byte to copy)
-------------------------------------------------------------------------------------------------------------------
0005cc64: 27bdfff8 addiu r29,r29,-0x008     |
0005cc68: 18c00008 blez r6,0x0005cc8c       #If Data Size > 0x00 /Else branch to  END
0005cc6c: 00001821 addu r3,r0,r0                |r3 = 0x00 (loop counter)
0005cc70: 90820000 lbu r2,0x0000(r4)            |r2 = This Iteration Byte
0005cc74: 24840001 addiu r4,r4,0x0001           |r4 = Origine data pointer  (+0x01 each iteration)
0005cc78: 24630001 addiu r3,r3,0x0001           |r3 = Loop counter +1 
0005cc7c: a0a20000 sb r2,0x0000(r5)             |Store This iteration byte in Destination pointer
0005cc80: 0066102a slt r2,r3,r6                 |r2 = 0x01 if counter < Data size
0005cc84: 1440fffa bne r2,r0,0x0005cc70     Λ Loop while counter < Size of data to copy
0005cc88: 24a50001 addiu r5,r5,0x0001           |r5 = Destination data pointer (+0x01 each iteration)
0005cc8c: 27bd0008 addiu r29,r29,0x0008         
0005cc90: 03e00008 jr r31                   END
0005cc94: 00000000 nop                      

Return Locations

SCUS 942.21
0005a38c:  Out of Battle Unit Generation
0005cb38:  Store/Generate Character Names
0005cb54: ^^
0005cb70: ^^
0005cb8c: ^^
0005d6c4:  Status Setting/Checking + Equip/R/S/M Stats
0005d6d4: ^^
0005d6e4: ^^