Dear Programmers, Hi
I wrote a simple asm program to output a char on STDOUT in windows (MS-DOS)
Here is my code:
------------------------------------
.386
.MODEL FLAT
.STACK 256 ;Reserve 256-Bytes
.DATA
char BYTE "a"
.CODE
_main:
MOV AH, 02h ;Sub-function 02h -> Output STDOUT
MOV DL, char ;Char to output
INT 21h
MOV AH, 4Ch ;Return 0
MOV AL, 00h
INT 21h
END _main
In DOS I assemble it with ml
ml /c /coff output_char.asm
and link it
link /subsystem:console /entry:main /out:output_char.exe output_char.obj kernel32.lib
----------------------
It assemble fine and i get the exe file but when i run it, it gives me
output_char.exe has encountered a problem and needs to be close....
Can you guys help me to understand what is wrong in my code (This is my first asm program)?
Thanks
Mark