Hi,
First i would like to say thank you to Pype.Clicker, But i still need help with this function:
First off all, i do not have the intel manuals :'(
So if somebody could tell me the opcode for a far jump.
And, also, this is the code i am going to use, could somebody please check through it, of course it doesn't work because i don't have the opcode thingy. Anyways, what is opcode??
Here is the Code, I am actually going to use this code, so please, somebody check it, and if anything is wrong with is, edit this code:
Code: Select all
[GLOBAL _SwitchMode]
_SwitchMode:
[BITS 32]
cli
push ebp
mov ebp, esp
pushad
mov ebx, [ebp+8]
mov ecx, RealMode
add ecx, 0h
mov dl, 0x0F
and dl, cl
shr ecx, 4
mov byte[RealMode_Offset], dl
mov word[RealMode_Segment], cx
jmp FlushPipeline
FlushPipeline:
mov eax, cr0
mov edx, eax
and eax, 0x7FFFFFFE ;0x7fff fffe
mov cr0, eax
;db JMP_FAR_OPCODE
RealMode_Offset db 0, 0
RealMode_Segment dw 0
[BITS 16]
RealMode:
mov ax, 0x9000
mov ss, ax
mov sp, 0xFFFE
mov ax, bx
int 0x10
mov cr0, edx
[BITS 32]
jmp 0x08:ProtectedMode
ProtectedMode:
popad
sti