More explicitly, the variable 0x8000 must contain the value that will be set to your team's pokémon (happiness, but with this routine you can also modify other attributes).
The index of the attribute to be modified must be contained in the variable 0x8001 (in your case happines corresponds to 0x20).
The list of the attribute index is shown below: