News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

DI and SI

Started by buli, April 24, 2016, 06:50:01 PM

Previous topic - Next topic

buli

I am confused that DI and SI can point to the same address
below it's my code

.MODEL SMALL
.STACK
.DATA
   NUM1 DB 10,11,12,14
.CODE
MAIN:
    MOV AX,@DATA
    MOV DS,AX
    MOV DI,OFFSET NUM1
    MOV SI,OFFSET NUM1
    MOV DL,[DI]
    ADD DL,30H
    MOV AH,02H
    INT 21H
    MOV DL,[SI]
    ADD DL,30H
    MOV AH,02H
    INT 21H
    MOV AH,4CH
    INT 21H
END MAIN

I used the debug tool and saw that DI and SI are shifted into same address,when i print the content they are same!! But i know that DI belongs to ES and SI belongs to DS. But OFFSET just calculate the variable's offset. Why they can print the same content? 

nidud

#1
deleted

buli

Thanks a lot~~
By the way
I begin to suspect that my book is .........