a basic problem
Posted: Sun Jan 11, 2004 11:47 pm
the following code is part of Viridis 0.5.0.if u look at comment after setting esp,the coder aims to set asp at largest possible value.but 0xffff equals to 64k.and base of DATASEL is x0.then how could esp point to largest possible value in segment pointed to by DATASEL.
if there is some error then what value should i move to esp.
if there is some error then what value should i move to esp.
Code: Select all
mov eax,DATASEL??????
mov ds,eax??????
mov es,eax
mov fs,eax
mov gs,eax
mov ss,eax
mov esp,0xffff ;set esp to the largest possible value
DATASEL EQU $-GDT ; 4GB Flat Data at 0x0 with max 0xFFFFF limit
DW 0xFFFF ; Limit(2):0xFFFF
DW 0x0 ; Base(3)
DB 0x0 ; Base(2)
DB 0x92 ;present,ring0,data/stack,read/write(10010010)
DB 0xCF ; Limit(1):0xF | Flags:4Kb inc,32bit (11001111)
DB 0x0 ; Base(1)