Store consecutive UART inputs to register
To do this properly, you need to implement some sort of framing protocol with a state machine. I recommend cooking up a basic packet format that at least has some sort of magic number identifier in the header that the state machine can look for. This is used to discard any extra bytes that might be received due to line noise, etc. The state machine looks for that (might ended just be one byte), discards it, and then stores the following bytes into the correct locations in the output register.