0

I'm using emu8086 and I want to move a byte from 20h to 60h (DS segment). I've tried to do a direct addressing both for destination and for source but it does not work, and I'm wondering why?

mov [60h], [23h] 

I've done it like that in the end:

mov AL, [23h]
mov [60h], AL

I'm curious why the first doesn't work, I mean, I'm allowed to do direct addressing on source and on destination, why not on both at the same time? I'm thinking that probably the emulator wants to know if I'm moving a byte or a word, so he needs to see AX or AL, meanwhile in the first case it doesn't know how much data to move?

Peter Cordes
  • 286,368
  • 41
  • 520
  • 731
  • 1
    No, the memory to memory move is not allowed because there is no such encoding of the `mov` instruction. No 8086 instruction has two explicit memory operands. However, there are cases where there is a valid encoding that doesn't have a register to tell the assembler what size to use. In this case you need to specify, eg `mov byte ptr [100h], 26h` or `mov byte [100h], 26h` (Those are instructions with a memory destination and an immediate value source.) – ecm Oct 16 '21 at 20:08

0 Answers0