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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
slacker

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

Post 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....
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

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

Post 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).
pini

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

Post 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
Post Reply