Confused about selectors
Posted: Sat Mar 28, 2009 5:15 pm
Hey,
I've entered into protected mode, and was just setting the selectors. On osdev wiki, I saw:
But according to a few other websites, such as http://www.internals.com/articles/protmode/protmode.htm and http://members.tripod.com/protected_mod ... tmode.html , the selectors jsut have their higher 13 bits to the offset. The lower 3 bits are for other tasks... So why shouldn't the above code be-
um... don't get me wrong, the wiki is right, but I'd just like to know why.
I've entered into protected mode, and was just setting the selectors. On osdev wiki, I saw:
Code: Select all
; Reload data segment registers:
MOV AX, 0x10 ; 0x10 points at the new data selector
MOV DS, AX
MOV ES, AX
MOV FS, AX
MOV GS, AX
MOV SS, AX
RET
Code: Select all
mov ax,0x10
mov cl,3
shl ax,cl ; Should zero out the lower bits
mov ds,ax
.....
um... don't get me wrong, the wiki is right, but I'd just like to know why.