TL;DR:
Use the correct Intel 8085 opcode for
Use the correct Intel 8085 opcode for
MOV B, C: 41. Assemble it as 01000001. If your toolchain still balks, force the byte with DB 41h in NASM syntax.
What’s causing this error?
Your assembler isn’t happy because it can’t translate MOV B, C into valid 8085 machine code. The MOV instruction copies data between registers, and for this specific move—from C to B—the Intel 8085 expects the single-byte opcode 41. That’s just how the chip’s instruction set works. The assembler should handle this automatically, but sometimes it doesn’t.
How do I fix it step by step?
- Double-check your mnemonic.
MOV B, Cis absolutely valid in 8085 assembly—it means “copy whatever’s in C over to B.” If your assembler still complains, move to the next step. - Look at your assembler’s settings. NASM, GAS, and ASM80 all understand
MOV B, C, but some tools default to 8086 mode. That’s a common tripwire. Check your project’s configuration. - Bypass the assembler entirely. Sometimes the easiest fix is to drop the raw byte straight into your source. Add this line:
section .text db 41h ; Intel 8085 machine code for MOV B, CThen assemble withnasm -f bin prog.asm -o prog.bin. No translation needed. - Confirm the output. Run
ndisasm -b 85 prog.binand you should see:00000000 41 mov b,c
If that line appears, your instruction is correct. - Test it in a simulator. Fire up an 8085 simulator like Sim8085 and step through the instruction. You’ll see register B change to match whatever was in C before the move.