Re: bits 32 oddities in NASM
- From: "James Daughtry" <mordock32@xxxxxxxxxxx>
- Date: 23 Mar 2006 07:08:55 -0800
Frank Kotler wrote:
James Daughtry wrote:
...
I was experimenting to see if I could use DOS interrupts with 32-bit
registers.
Yeah, you can. It was the "bits 32" that was killin' ya, not the 32-bit
registers. You can use 32-bit addressing modes in 16-bit code (but you
have to keep the total offset within the 64k-1 limit). This can be
*very* handy.
But, since dos (and bios) interrupts are 16-bit code, Nasm needs to be
generating 16-bit code to operate there. This means that using 32-bit
registers will require an "override prefix byte" - 66h for an operand
size, and 67h for address size. Nasm will generate these, where needed -
you don't have to do it. There's a slight "penalty" in terms of "bloat"
and speed, but the gains are often worthwhile.
Okay, but even though I'm using 32-bit addressing, the stack is still
scaled to 16-bits? The program works fine if I remove the bits
statement and change the 4's to 2's when scaling esp for the subroutine
argument. I'm curious why that is, and what else would be different.
.
- Follow-Ups:
- Re: bits 32 oddities in NASM
- From: Rod Pemberton
- Re: bits 32 oddities in NASM
- References:
- bits 32 oddities in NASM
- From: James Daughtry
- Re: bits 32 oddities in NASM
- From: santosh
- Re: bits 32 oddities in NASM
- From: James Daughtry
- Re: bits 32 oddities in NASM
- From: Frank Kotler
- Re: bits 32 oddities in NASM
- From: James Daughtry
- Re: bits 32 oddities in NASM
- From: Frank Kotler
- bits 32 oddities in NASM
- Prev by Date: Re: bits 32 oddities in NASM
- Next by Date: Re: RosAsm Bliss, and NASM Bliss
- Previous by thread: Re: bits 32 oddities in NASM
- Next by thread: Re: bits 32 oddities in NASM
- Index(es):
Relevant Pages
|