This is called an
assembler. An assembler converts mnemonics and opcodes to binary
machine language.
An assembler targets a specific microprocessor or microcontroller, so the one you need will depend on the processor on which the code needs to run.
If I assume you're targeting Intel x86 processors for DOS or Windows, you want an assembler like
MASM32[
^].