From: Frank K. <fbk...@ve...> - 2007-07-26 10:00:07
|
Martin Knappe wrote: > hi > > i just came across some very strange behaviour of the nasm compiler > take a look at this piece of code: > > > BITS 16 > > ;some 16-Bit code > > cli > > lgdt [gdt_desc] > > mov eax, cr0 ;Enable > > or eax, 1 ;protected > > mov cr0, eax ;mode > > jmp 20h:enter_32 ;where 20h is selector for this very segment > > > > > BITS 32 > > enter_32: > > hlt > > > if i execute this, the screen completely blanks upon the jump to enter_32 > > now if i leave out the line "BITS 32" (i.e. if i compile for 16 BITS), > the screen stays as it is! > > is there a sensible explanation for this?? I see absolutely *no* difference between binaries with or without the "BITS 32". What strange behavior of the Nasm compiler are you referring to? Unless you *do* see a difference in binaries, the strangeness originates elsewhere. What's your environment? Real boot? Dos? Emulator? Best, Frank |