Author Topic: how to mix 16bits and 32bits code?  (Read 8935 times)

nobody

  • Guest
how to mix 16bits and 32bits code?
« 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.

nobody

  • Guest
Re: how to mix 16bits and 32bits code?
« Reply #1 on: January 04, 2009, 04:59:11 AM »
sorry , i found the answer myself.

bits 16 / bits 32 can do this job.