0

I am trying to understand some of the programs that were written for MS DOS. Does the instruction mov ax, ds:4Ch move the value of ds*16 + 4Ch or does it move the value stored at the address ds*16 + 4Ch?

1
  • The latter. In fact, there is no direct way to load the value ds*16 + 4Ch. Commented Jan 23, 2019 at 21:11

1 Answer 1

1

It's a memory operand because it uses ds:. MASM-style Intel syntax doesn't require [] around memory operands.

Also, there's no single machine instruction that will calculate a linear address in an integer register. The whole point of segmentation is to deal with linear addresses that are too big for a single register. You can do it manually if you want if you're in real mode (where the segment register value is the base, like mov ax, ds / shl ax, 4), but not as easily if the segment register value is just a selector. 286/386 protected mode, or Unreal mode.

lea ax, [es: bx + si + 12] for example only deals with offset calculations, ignoring the segment base.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.