The most basic 8086 instruction which COPIES data to a destination from a source. The first argument is the destination. After the operation, the source data is preserved.

Obviously, you cannot store data in an immediate. You cannot redefine 69 to be 42.

Usually your assembler compiler will detect which of the below physical opcodes to use by looking at the given parameters. The source and destination sizes must be the same, if both are not ambiguous. If they are not, your compiler should generate an error upon compile.

In the case of the following,

MOV var,42


From a higher level, this looks as if the hacker is trying to move the value "42" into the "var". When the computer looks at 'var', it actually sees an offset. It understands this command as "I know of a value 'var' bytes into the data segment. Store the value 42 into it". The code has no idea how many bytes to copy over. Since 'var' is just a pointer into memory, the programmer could mean move the word into the two bytes starting at 'var'. Or it could mean move a byte into it. Or a double word. You can usually give a hint to your compiler, such as
MOV word ptr var,42
or
MOV byte ptr var,42
On my machine, with TASM, this translates into to
C706 0000 2A00
Depending on the arguments, the binary opcode may be any of the following, followed by immediate values (constants).
MOV   MemOfs,Acc  1010001w
MOV   Acc,MemOfs  1010000w
MOV   Reg,Imm     1011wrrr
MOV   Mem,Imm     1100011wff000mmm
MOV   Reg,Reg     1000101wffrrrmmm
MOV   Reg,Mem     1000101wffrrrmmm
MOV   Mem,Reg     1000100wffrrrmmm
MOV   Reg16,Seg   10001100ffsssmmm
MOV   Seg,Reg16   10001110ffsssmmm
MOV   Mem16,Seg   10001100ffsssmmm
MOV   Seg,Mem16   10001110ffsssmmm
Where ff is the Function
  • 00 - If mmm = 110, then a displacement follows the operation; otherwise, no displacement is used
  • 01 - An 8-bit signed displacement follows the opcode
  • 10 - A 16-bit signed displacement follows the opcode
  • 11 - mmm specifies a register, instead of an addressing mode
and mmm is the addressing mode (unless ff says otherwise)
000 : DS:[BX+SI]
001 : DS:[BX+DI]
010 : SS:[BP+SI]
011 : SS:[BP+DI]
100 : DS:[SI]
101 : DS:[DI]
110 : SS:[BP]
111 : DS:[BX]
and rrr is the register size
      W=0 : W=1 : reg32 
000 : AL  : AX  : EAX 
001 : CL  : CX  : ECX 
010 : DL  : DX  : EDX 
011 : BL  : BX  : EBX 
100 : AH  : SP  : ESP 
101 : CH  : BP  : EBP 
110 : DH  : SI  : ESI 
111 : BH  : DI  : EDI 
And sss specifies which segment register to use
000 : ES 
001 : CS 
010 : SS 
011 : DS 
Binary Opcodes Found At: http://courses.ece.uiuc.edu/ece291/resources/opcodes.html