I just checked the manual again and MOV Immediate, REG is not allowed and in fact is illogical, but when I compile, it runs just fine.
Asked
Active
Viewed 103 times
4
-
Have you also checked the actual code generated, what machine instruction was actually deployed there ( disassembly view )? – user3666197 Apr 10 '18 at 20:02
-
@user3666197 No I am sadly a beginner. I don't like being spoon fed so I will look further into disassembly view right away. Thank you very much for the guidance :) – superflash Apr 10 '18 at 20:04
-
2This is an oddity in EMU8086. When the destination is an immediate it assumes that you meant a memory operand so it will assume 0900h is `[ds:0900h]` . EMU8086 would have probably translated your instruction to `mov [ds:0900h], ax` or equivalent. – Michael Petch Apr 10 '18 at 20:07
-
I just read the debug logs and saw this line MOV [00900h], AX, it all makes sense now. Thank you very much @MichaelPetch. – superflash Apr 10 '18 at 20:09
-
Yes, a piece of a first-hand experience **:o)** – user3666197 Apr 10 '18 at 20:11
-
@MichaelPetch please post you answer as an answer. This is a recurring, practical problem, a perfect fit for SO. – ivan_pozdeev Apr 10 '18 at 20:13
-
You can self answer your own question, please be my guest – Michael Petch Apr 10 '18 at 20:20
1 Answers
1
The instruction MOV immediate value, REG is invalid but emu8086 corrects for this case. Instead of considering 0900h in MOV 0900h, ax as an immediate value, it marks 0900h as [DS:0900h] which represents a certain memory location.

superflash
- 105
- 1
- 10