using 'mov' between segments

Started by
1 comment, last by VanillaSnake21 16 years, 8 months ago
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.

You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts

Advertisement
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).
Ra
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!!

You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts

This topic is closed to new replies.

Advertisement