ASSUME

Hi Guys;
i'm beginner in assembly & i have a question:

we assign segment addresses to segment registers via ASSUME:

[b][italic] ASSUME ds:DataSg, cs:CodeSg, ss:StkSg [/italic][/b]

And then @ the code segment we move data segment address to DS via AX:
[b][italic]
Mov AX,DataSg
Mov DS,AX
[/italic][/b]
what's the reason!?!?
tnx;

Comments

  • : Hi Guys;
    : i'm beginner in assembly & i have a question:
    :
    : we assign segment addresses to segment registers via ASSUME:
    :
    : [b][italic] ASSUME ds:DataSg, cs:CodeSg, ss:StkSg [/italic][/b]
    :
    : And then @ the code segment we move data segment address to DS via AX:
    : [b][italic]
    : Mov AX,DataSg
    : Mov DS,AX
    : [/italic][/b]
    : what's the reason!?!?
    : tnx;
    :
    [blue]Good god, man!
    That is so OLD!

    But, whatever...

    CPU in real mode always uses a pair of registers to access data (your variables). It uses SEGMENT:OFFSET registers. So, ASSUME tells code generator which register to use when you accessing a variable from a segment specified.

    I urge every beginner to begin with FASM - which has no ASSUMES, no linkers - nothing of that old junk, just one main file and a lots of include files, if program is large.[/blue]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion