Difference between revisions of "Store X into Y"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
Line 1: Line 1:
  Store X into Y (r4 = Loading Pointer, r5 = Storing Pointer)
+
  '''Parameters''' : r4 = Origin Data Pointer                 rq : redundant with [[Store_X_Byte_into_Y]]
  0005cc64: 27bdfff8 addiu r29,r29,0xfff8
+
              r5 = Destination Data Pointer
  0005cc68: 18c00008 blez r6,0x0005cc8c
+
              r6 = Data size (number of bytes)
  0005cc6c: 00001821 addu r3,r0,r0 Counter = 0
+
  0005cc70: 90820000 lbu r2,0x0000(r4) Load X
+
This routine Load Data from r4 and Store it in r5  (r6 = number of byte - one loop iteration per byte to copy)
  0005cc74: 24840001 addiu r4,r4,0x0001 X Pointer += 1
+
-------------------------------------------------------------------------------------------------------------------
  0005cc78: 24630001 addiu r3,r3,0x0001 Counter += 1
+
  0005cc64: 27bdfff8 addiu r29,r29,-0x008    |
  0005cc7c: a0a20000 sb r2,0x0000(r5) Store X into Y
+
  0005cc68: 18c00008 blez r6,0x0005cc8c       {{f/Cond|If Data Size > 0x00}} /Else branch to  {{f/loc|END}}
  0005cc80: 0066102a slt r2,r3,r6
+
  0005cc6c: 00001821 addu r3,r0,r0               |{{f/std|<nowiki>r3 = 0x00 (loop counter)</nowiki>}}
  0005cc84: 1440fffa bne r2,r0,0x0005cc70 Branch if not finished
+
  0005cc70: 90820000 lbu r2,0x0000(r4)           |{{f/load|<nowiki>r2 = This Iteration Byte</nowiki>}}
  0005cc88: 24a50001 addiu r5,r5,0x0001 Y Pointer += 1
+
  0005cc74: 24840001 addiu r4,r4,0x0001           |{{f/adr|<nowiki>r4 = Origine data pointer  (+0x01 each iteration)</nowiki>}}
  0005cc8c: 27bd0008 addiu r29,r29,0x0008
+
  0005cc78: 24630001 addiu r3,r3,0x0001           |{{f/std|<nowiki>r3 = Loop counter +1 </nowiki>}}
  0005cc90: 03e00008 jr r31
+
  0005cc7c: a0a20000 sb r2,0x0000(r5)             |{{f/store|Store This iteration byte in Destination pointer}}
  0005cc94: 00000000 nop
+
  0005cc80: 0066102a slt r2,r3,r6                 |{{f/std|<nowiki>r2 = 0x01 if counter < Data size</nowiki>}}
 
+
  0005cc84: 1440fffa bne r2,r0,0x0005cc70     {{f/eloop|Loop while counter < Size of data to copy}}
 +
  0005cc88: 24a50001 addiu r5,r5,0x0001           |{{f/adr|<nowiki>r5 = Destination data pointer (+0x01 each iteration)</nowiki>}}
 +
  0005cc8c: 27bd0008 addiu r29,r29,0x0008        
 +
  0005cc90: 03e00008 jr r31                   '''END'''
 +
  0005cc94: 00000000 nop                    
  
 
== Return Locations ==
 
== Return Locations ==
 
+
'''SCUS 942.21'''
 
  0005a38c:  [[Out of Battle Unit Generation]]
 
  0005a38c:  [[Out of Battle Unit Generation]]
 
  0005cb38:  [[Store/Generate Character Names]]
 
  0005cb38:  [[Store/Generate Character Names]]

Latest revision as of 20:34, 20 March 2022

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: ^^