Vstbutwhy
Vstbutwhy

Reputation: 73

Assembly language programming transfer of control from one segment to another

I am unable to understand that first we move CS into SS in line 1 and line 2 but then we assign SS to a completely different value SYSINITSEG (line 3). Why we moved CS to SS when we have to move SYSINITSEG to SS.

more code here....... 

MOV AX, CS.              ;line1
MOV SS, AX.              ;line2
MOV SP, OFFSET LOCSTACK

ASSUME SS:SYSINITSEG.      ;line3

LOCSTACK LABEL BYTE

more code here....... 

Upvotes: 0

Views: 135

Answers (1)

fuz
fuz

Reputation: 93127

Line 3 does not assign anything to SS. It merely tells the assembler that it should assume that you set SS to the segment SYSINITSEG, which the preceding code presumably does.

The assembler needs this information so it can compute offsets to symbols referred to through the SS segment.

Upvotes: 2

Related Questions