Difference between revisions of "FF7/Field/Script/Opcodes/9B HBYTE"

From Final Fantasy Inside
< FF7‎ | Field‎ | Script‎ | Opcodes
Jump to navigation Jump to search
my_wiki>Synergy Blades
 
m (5 revisions imported)
 
(4 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
==== Memory layout ====
 
==== Memory layout ====
 
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
 
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! width="40" | 0x9A
+
! width="40" | 0x9B
 
! width="40" | ''D / S''
 
! width="40" | ''D / S''
 
! width="40" | ''DA''
 
! width="40" | ''DA''
! width="60" | ''SA'' or ''LB''
+
! width="80" | ''SA''
! width="60" | ''0'' or ''HB''
 
 
|}
 
|}
  
Line 17: Line 16:
 
* '''const Bit[4]''' ''S'': Source bank.
 
* '''const Bit[4]''' ''S'': Source bank.
 
* '''const UByte''' ''DA'': Destination address.
 
* '''const UByte''' ''DA'': Destination address.
* '''const UByte''' ''SA'': Source address, ''or'' the lower byte of the given word, if source bank is zero.
+
* '''const UShort''' ''SA'': Source address, ''or'' the word given as a literal, if source bank is zero.
* '''const UByte''' ''0'': Zero, ''or'' the higher byte of the given word, if source bank is zero.
 
  
 
==== Description ====
 
==== Description ====
  
Retrieves the high byte of a two-byte word from the source bank and address, and places the byte value into the destination bank and address. If the source bank is zero, then the final two arguments are actually an explicit given two-byte word value, and the high byte value is retrieved from this word instead of from a memory address.
+
Retrieves the high byte of a two-byte word from the source bank and address, and places the byte value into the destination bank and address. If the source bank is zero, then the final two arguments are actually a given two-byte word value, and the high byte value is retrieved from this word instead of from a memory address.

Latest revision as of 05:18, 23 May 2019

  • Opcode: 0x9B
  • Short name: HBYTE
  • Long name: High Byte

Memory layout

0x9B D / S DA SA

Arguments

  • const Bit[4] D: Destination bank.
  • const Bit[4] S: Source bank.
  • const UByte DA: Destination address.
  • const UShort SA: Source address, or the word given as a literal, if source bank is zero.

Description

Retrieves the high byte of a two-byte word from the source bank and address, and places the byte value into the destination bank and address. If the source bank is zero, then the final two arguments are actually a given two-byte word value, and the high byte value is retrieved from this word instead of from a memory address.