On Thu, Dec 27, 2007 at 06:43:22PM +0800, Bean wrote:
> On Dec 27, 2007 5:57 PM, Robert Millan <[EMAIL PROTECTED]> wrote:
> > Why not force it with .code32 / .code16 ?
> 
> No, you can't use .code32/.code16, it will not cause compile error,
> but the machine code is wrong. However, you can write it like this:
> 
> .byte 0x66, 0x67
> .code32
> leal  0x200 + data_start - data_next(%ebx,%eax), %eax
> .code16
> 
> 0x66 and 0x67 is the DATA32 and ADDR32 prefix, it tell the cpu that
> the next instruction use different registry and address mode. (16-bit
> %ax -> 32-bit %eax, 16-bit address mode to 32-bit address mode).

Uhm I recall seeing macros for that already:

  kern/i386/pc/startup.S:       DATA32  ADDR32  lgdt    gdtdesc

I guess those are telling GAS to generate 0x66 and 0x67?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to