Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am learning x86 assembly, and when I run the following program in debug, it works fine and prints the character 'A'.
MOV AH,02h
MOV DL,2Ah
INT 21
INT 20However, when I run this program with the following source
.MODEL SMALL
.CODEMOV AH,02h
MOV DL,2Ah
INT 21
INT 20.EXIT
ENDand run it though masm and the linker, nothing prints on the screen.
masm test.asm
link test.objAny ideas?

You are running the DEBUG version from a DOS command prompt so it works. INT 20 and INT 21 are DOS interrupts.
Compiling it and running under Win2000 won't work because there is no DOS to process the interrupts. You could well be corrupting your memory running DOS interrupts from Windows.
Stuart

What can I do about it besides running in pure DOS mode?
Where can I find equivalent Windows interrupts/functions?

The equivalent in Windows is the API - Application Programming Interface. How you call the API with assembler I have no idea.
Using the API is usually done with a high level language like C++. Assembly language programming is fraught with problems as Windows 2000/XP will not allow you to to talk directly to the hardware which is what you are trying to do with your snippet of code.Windows is not a good environment to go poking around with assembly code but it can be done.
Have a look at these links:
http://www.geocities.com/thestarman3/asm/win32/index.html
http://www.masm32.com/
Stuart

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |