Take the value you want to get, let's say 456, divide it by 256, and only take the whole part (this is "integer division"):
456 div 256 = 1
Then take the original value again, divide it by 256 and take the remainder (this is "modulo"):
456 mod 256 = 200
Convert the results into hex:
And finally, replace the ?? spots in the GameShark codes:
If it works incorrectly, try putting the bytes in a reverse order (Gen I is very inconsistent with its endianness, the least significant byte sometimes goes first, sometimes goes last).
Although I'm not sure where you got the codes in the first place, they point to the second PC Pokemon's moves.
Alternatively, you can just convert the target value into hex and split it every two numbers, adding a leading zero if necessary:
456 = 0x1C8 = 0x01C8
So the values are: 01, C8
Without entering any math details, the first number is the "multiples of 256", and the second is added to the first number. So with 01 C8:
1 * 256 + 0xC8 = 256 + 200 = 456