'moving memory operand to segment register,assembly(x86)
Are we able to move a memory operand to a segment register in these ways using MOV instruction in assembly(x86) language ?
1.
MOV DS,[BX]
2.
MOV DS,[6401H]
Solution 1:[1]
Dude - nobody even uses the DS register this century :)!
I'd strongly encourage you to learn 32-bit assembler. If you have access to Linux, this is an excellent resource:
To answer your question - I believe "No". You typically load DS from the AX register (although you can certainly use any of the other three general-purpose registers).
To be absolutely sure, you should look it up in the Intel reference manual (you should be able to find it on Google).
PS:
When I say "32-bit", I hasten to add that anything you learn for x86-32 is directly applicable to x86-64. But much (most?) of the stuff you learn for 16-bit DOS is not applicable to any contemporary (read: virtual memory/linear address space) system.
IMHO...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | paulsm4 |
