Here is my question.

We declare: var1 db 1
and consider that in memory var1 will be placed at address 0100h

Now,when we move var1(byte long) in AX (which is 16 bits long) AX will be filled with value at memory location 0100h + value at 0101h, because AX must be filled with 2 bytes.

but what exactly happens if we write: mov AX [var1 + 1]

in the tutorial that I'm reading says that this statement puts in AX the value of two bytes beginning from adres 0101h ,not 0100h !

why?

Because [var+1] is a pointer to a location
as Var1 is declred as a Byte(a place HOLDER),It has nothing to do with the instruction.
The programmer MUST use the RIGHT instruction

0100h +1h ==>> 0101h
and the Instruction mov AX works on a WORD
If it was mov EAX[var1+1]it woud take 4 bytes starting from 0101h to 0104h and put them in EAX.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.