Page 1 of 1

need help...segment selectors in pmode.....

Posted: Wed Feb 19, 2003 8:43 am
by slacker
if anyone could help me i would greatly appreciate it...
lemme see if i get this....in pmode..a20 enabled..memory is referenced by placing a segment selector in a segment register..
ex.
mov ax, segselector
mov cs, ax
jmp 0x00 <--will jump to base of codeseg whether base starts at 0:0 or 50:0...this will also load CS with a segment selector

thanks anyone....

Re:need help...segment selectors in pmode.....

Posted: Wed Feb 19, 2003 9:37 am
by Pype.Clicker
you cannot mov cs,<something>. There is no such instruction in the IA-32. cs and eip can both be set up with a far jump (jmp segment:offset).

Re:need help...segment selectors in pmode.....

Posted: Thu Feb 20, 2003 5:06 pm
by pini
right. If you want to put a selector in CS, you must do a far jump using this syntax (with NASM) :

Code: Select all

jmp dword SELECTOR:ADDRESS
Where SELECTOR is a valid entry in your GDT and ADDRESS is (here) a 32-bit memory location