NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on January 04, 2009, 04:54:45 AM

Title: how to mix 16bits and 32bits code?
Post by: nobody on January 04, 2009, 04:54:45 AM
I'm writing some boot code. so i want to mix 16bits and 32bits assembling.
it seems diffcult to do this in nasm.
what i want is something like this:

set-16bits-mode:
xor ax,ax

set-32bits-mode:
xor eax,eax

i want both the above instructions generate the same code 33 c0.
Title: Re: how to mix 16bits and 32bits code?
Post by: nobody on January 04, 2009, 04:59:11 AM
sorry , i found the answer myself.

bits 16 / bits 32 can do this job.