How do I translate assembly to binary

I have an assignment where I have to decode and encode certain assembly commands in order to find their translations. For Example, I am given
LW,5 1000
as a command and I need to translate it into an int. I am given the LW, 00110010, but I don’t understand how I would add the following translation of the “5 1000” to the LW. I was given a hint of using index of and this is what I have so far.
The work I’ve done towards this issue.

I am completely stuck and have no clue what to do please help!