32-bit 16-bit code and code segments

In fact, it is the assembler, like move eax, [0x1000] This assembler, assembler instructions you need to know is to get cpu to run in 32-bit mode or 16-bit mode.

Assembler to decide whether to add the prefix address width.

So [.bits 16], [. Bits 32] Such guiding assembly instructions directly affect nasm generated code.

 

Further, cpu there is a segment descriptor tag D, control is actually a segment as the cpu is 32 or 16-bit segment.

D is a code segment, the default operation is 32-bit address rather than a 16-bit width.

D 1 is a stack segment, rather than the default, esp sp.

 

Prefix opcode is 0x66, 0x67 is the address prefix.

Guess you like

Origin www.cnblogs.com/xiang-yin/p/12149574.html