Re: bits 32 oddities in NASM
- From: "santosh" <santosh.k83@xxxxxxxxx>
- Date: 22 Mar 2006 07:09:39 -0800
James Daughtry wrote:
Frank Kotler wrote:
Google glitches. :-P
Not written in asm - that's its damn problem! :)
Amen! :-)
When (if?) you sort through the replies to your original post, get back
to us with what you're trying to do. Looks like you've got one foot in
dos, and one in 32-bit... won't work unless you "take steps". - dos
extender or switch to pm yourself - and *then* dos interrupts won't work...
I was experimenting to see if I could use DOS interrupts with 32-bit
registers. I know I can do it with 16-bit registers, to some extent.
Most likely because there's some hidden emulation layer that caters to
stupid people who try to write DOS in Windows. ;-) Are interrupts real
interrputs on Windows XP? Or do they end up calling a Win32 function?
When a DOS program is run under Windows XP, ntvdm.exe takes care of
emulating all the DOS and BIOS calls. So yes, in a roundabout way, they
do end up calling code in Windows.
To be perfectly honest, I wanted to find a convenient way to do I/O
without resorting to the C library or the evil Win32 API. Interrupts
are simple and relatively easy to use. The C library is very simple and
easy to use, for me, but I can imagine it being somewhat bloated for an
assembly program. I *hate* the Win32 API with a well honed passion,
even for simple things, and I try to avoid it. :-)
Well, there's no way to do IO under Windows without at some point or
the other calling an API function. In fact calling it directly yourself
will be the fastest, least circutious route. The C library ends up
calling the Win32 API internally while a DOS INT instruction will trap
into NTVDM, which will inturn call several internal routines in Windows
to do it's emulation for your real mode program.
Of course writing to ports or otherwise interfacing directly with the
hardware is forbidden within user-mode programs. You could probably
write a Kernel Driver but it isn't worth that much trouble.
The shortest code path to do stuff in Windows is to call it's API,
(perhaps via INT 2Eh). So if you *hate* the Win32 API, you'll be
crippled, programming under Windows.
So why not change over to Linux/BSD? They've got a rich set of APIs
accessible via the software interrupt and you can even do some direct
hardware stuff if you run as root.
.
- 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
- bits 32 oddities in NASM
- Prev by Date: Re: RosAsm Bliss, and NASM Bliss
- Next by Date: CodeView Info
- Previous by thread: Re: bits 32 oddities in NASM
- Next by thread: Re: bits 32 oddities in NASM
- Index(es):
Relevant Pages
|