Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > require encodin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 17 Topic 4631 of 4646
Post > Topic >>

require encoding

by "Helge Kruse" <spamtrap@[EMAIL PROTECTED] > Apr 26, 2008 at 04:25 PM

Hello,

I wrote a x86 boot loader a long time ago. One step is to jump form 16 bit
to 32 bit segment before entering protected mode. I found 
that I need the opcode

_BOOT SEGMENT PARA USE16 PUBLIC 'ZZZZ_LINK_REALLY_LAST'

 00000076  66         db 66h   ;----- jmpf cs:pInitCpuFlush -----
 00000077  2E         db 2Eh   ; CS:
 00000078  FF 2E      db 0FFh, 2Eh ; JMPF
 0000007A  0000001E R dd OFFSET pInitCpuFlush

_INIT SEGMENT PARA USE32 PUBLIC 'ZZZ_LINK_AT_LAST'

 0000001E   pInitCpuFlush LABEL FWORD
 0000001E  000000FC R    dd EnterProtMode
 00000022  0010     dw GdtCode - GdtNull


That works. When I try to encode this with normal instructions I get
different opcodes:

jmp cs:pInitCpuFlush

0000007E  67& 66| 2E: FF  jmp cs:pInitCpuFlush
       2D 0000001E R
 00000087  67& 66| FF 2D  jmp pInitCpuFlush
       0000001E R
 0000008F  67& 66| 2E: FF  jmp fword ptr cs:pInitCpuFlush
       2D 0000001E R
 00000098   _BOOT ENDS


Is there any way to write a clean jump to 32 bit segment?

/Helge




 17 Posts in Topic:
require encoding
"Helge Kruse"   2008-04-26 16:25:42 
Re: require encoding
"Alexei A. Frounze&q  2008-04-26 13:01:43 
Re: require encoding
"Helge Kruse"   2008-04-27 08:53:22 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-26 15:57:45 
Re: require encoding
Frank Kotler <spamtra  2008-04-27 07:12:10 
Re: require encoding
ArarghMail804NOSPAM <s  2008-04-27 04:16:02 
Re: require encoding
"Helge Kruse"   2008-04-27 08:51:27 
Re: require encoding
"Wolfgang Kern"  2008-04-27 11:21:40 
Re: require encoding
ArarghMail804NOSPAM <s  2008-04-27 04:15:01 
Re: require encoding
"Alexei A. Frounze&q  2008-04-27 02:58:54 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-27 04:26:48 
Re: require encoding
"Alexei A. Frounze&q  2008-04-27 04:03:20 
Re: require encoding
ArarghMail804NOSPAM <s  2008-04-28 00:49:27 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-27 10:36:53 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-27 10:46:45 
Re: require encoding
Brendan <spamtrap@[EM  2008-04-27 20:11:40 
Re: require encoding
"Alexei A. Frounze&q  2008-04-28 01:52:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 8:02:42 CDT 2008.