Well the title says it all. Im having a discussion with someone who claims that int 21h is only a 16bit asm command. But int 21h is also a 32bit command right?
Interrupts can be used in both 32bit and 16bit. However if you intend to make use of int 21h, most likely you intend to call DOS functions. DOS functions belong to the 16bit generation. If you are programming for windows, you should be calling APIs and not interrupts.
w00,
roticv is right, you can call int 21h and others from Windows but its not 32 bit code, its 16 bit code that with any late version (win95b upwards) can only be called by a device driver.
Interrupts are a DOS 16 bit left over that are occasionally used for hardware access but they are NOT 32 bit code.
roticv is right, you can call int 21h and others from Windows but its not 32 bit code, its 16 bit code that with any late version (win95b upwards) can only be called by a device driver.
Interrupts are a DOS 16 bit left over that are occasionally used for hardware access but they are NOT 32 bit code.
Interrupts are a DOS 16 bit left over that are occasionally used for hardware access but they are NOT 32 bit code.
Well, internally in windows, interrupt calls are still being used to call kernel services - a lot of stuff ends up in NTDLL.DLL (ring3/usermode), which does interrupt calls to access ring0/kernelmode.
But it's true that the 21h and other interrupts are 16bit DOS APIs and can't be called from windows applications. And while you _can_ use the NT native interrupt calling from your user applications, you shouldn't.
Well the title says it all. Im having a discussion with someone who claims that int 21h is only a 16bit asm command. But int 21h is also a 32bit command right?
No, for the simple reason that it's not a command. It's an instruction.
In both worlds, the 16-bit and the 32-bit, int 21h does the same. It triggers interrupt 21h. Under the DOS operating system, interrupt 21h has a well-defined interface. Under the Windows operating system, I'm not so sure :).
I should probably add that I tried to speak from a high level point of view. I didn't take subjects like protection into consideration.
And is there a difference between 32bit asm programming and win32 asm programming? Cause i would like to learn all about instruction like int 21H, 08H, 02H, and about JB,JA,ESI,EAX and stuff.
All i found on the net was a tutorial about win32 programming, how to create a dialog and such but it doesnt seem to use alot of the above instructions.
this is the link
http://win32asm.cjb.net/
All i found on the net was a tutorial about win32 programming, how to create a dialog and such but it doesnt seem to use alot of the above instructions.
this is the link
http://win32asm.cjb.net/
In reference to x86 programs, 32-bit ASM is typically used to denote the source code for x86 instructions that are to be run with default operand and address sizes of 32 bits. Win32 ASM programming means writing Win32 programs in assembly language. All Win32 programs use 32-bit code by the above definition.
All instructions are the same on the source level for 16-bit and 32-bit code, the only difference is in the encoding in that the absence and presence of size prefix bytes are reversed. In particular, INT instructions are the same in encoding and in operation regardless of the default size. They operate differently in real mode and protected mode, though.
INT instructions are available as a convenient interface between application programs and the underlying system. But Win32 does not define any software interrupts except for INT 3 (debugger breakpoint). There is therefore not much to say about interrupts in this context. For other systems, such as MS-DOS, you can usually find detailed specifications on their usage all over the Internet.
Some manuals can be found here:
http://www.x86.org/intel.doc/686manuals.htm
A HTML version of the 386 manual is available here:
http://www.baldwin.cx/386htm/toc.htm
Win32 programming information is found at msdn.microsoft.com
All instructions are the same on the source level for 16-bit and 32-bit code, the only difference is in the encoding in that the absence and presence of size prefix bytes are reversed. In particular, INT instructions are the same in encoding and in operation regardless of the default size. They operate differently in real mode and protected mode, though.
INT instructions are available as a convenient interface between application programs and the underlying system. But Win32 does not define any software interrupts except for INT 3 (debugger breakpoint). There is therefore not much to say about interrupts in this context. For other systems, such as MS-DOS, you can usually find detailed specifications on their usage all over the Internet.
Some manuals can be found here:
http://www.x86.org/intel.doc/686manuals.htm
A HTML version of the 386 manual is available here:
http://www.baldwin.cx/386htm/toc.htm
Win32 programming information is found at msdn.microsoft.com
http://www.madwizard.org/ has a good text on the basics of win32 assembly programming - and actually covers instructions, where iczelion's tutorials are mostly about the API.
Anyway it's worth mentioning that INT 21h in DPMI subsystem of any Win32 implements the so called TrueDPMI. This includes the 32-bit versions of standard DOS calls, like file operations, text display etc.