Sign in to follow this  
VanillaSnake21

using 'mov' between segments

Recommended Posts

Hi, this is a small assembly question, if I use move to move a register value to a mem location (ex mov word ptr loc, ax), where exacty will mov move it? I mean will it be @DATA:loc , @STACK:loc ? I want to move stuff to a buffer that is located in stack, but how can I tell the mov instruction the full address of the location I want to move to?? BTW. I'm doing 16 bit assembly for now, so I cant use extended registers etc.

Share this post


Link to post
Share on other sites
movs involving general registers implicitly use ds as the segment base. Stack registers have an implicit ss.

In 16-bit DOS executables, as far as I know, ds is almost always set to the data segment base. Either that or it's set to the executable code base (ds == cs).

Share this post


Link to post
Share on other sites
Quote:
Original post by Ra
movs involving general registers implicitly use ds as the segment base. Stack registers have an implicit ss.

In 16-bit DOS executables, as far as I know, ds is almost always set to the data segment base. Either that or it's set to the executable code base (ds == cs).


Thanks a lot, thats exactly what I needed, so all i have to do is just point ds to ss and then move to offset within ss. Thanks!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this