Jump to content
  • Advertisement
Sign in to follow this  
Gink

[BX+DI] question

This topic is 4799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

say I have a base address BX, and I have a value stored in DI. Even though DI is inside [BX+DI],its not going to access what is stored at the address DS:DI, is it? Seems like all it does is offset the BX value by the value stored in the DI register. Anyway, it seems like messy syntax.. wouldnt it make more sense for it to be [BX]+DI? (using nasm)

Share this post


Link to post
Share on other sites
Advertisement
You are right about the CPU not accessing DS:DI. The value of DI will be used as an offset. As for the syntax, I think it is fine just the way it is. Brackets around a register denote that its value will be treated as an address to memory. What seems logical to me is that the whole of the address (base + offset) ought to included in the brackets otherwise [BX] + DI would imply that you are adding DI to the value stored in memory at address : BX.

Anyways, don't forget that "base" and "offset" are concepts which pertain to the coder's solution of a specific problem and do not have a meaning for the assembler. You might view BX as "base" and DI as "offset" but then again BX is actually an offset from memory 0000:0000.

[Edited by - Aghis on July 31, 2005 8:24:02 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!