2

I am trying to move a value into a specific memory address. The value is defined in an external file as a set of WORDs, 16 bits on my system.

mov [0xb8000], [OperatingSystemBootText]

However, when I try to compile the code, the system says that I have an invalid combination of operators and operands. I've tried defining the memory address as a variable before placing it inside a bracket but that didn't work. I don't understand why this doesn't work. Thank you to the community member who suggested a similar question. It helped me solve the issue.

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
  • 4
    You can't move memory to memory with the `mov` instruction. You have to move the value from memory to a register and then move from the register to memory. Otherwise you'd have to use something like [movsw](https://www.felixcloutier.com/x86/movs:movsb:movsw:movsd:movsq) – Michael Petch Jun 14 '22 at 19:52

0 Answers0