Hello,

i wrote tiny program to output a single symbol, and it doesn't do the job. The whole code is below:

.MODEL SMALL
.DATA
.CODE
 
BEGIN:
MOV AH,02h ; function of printing single character 
MOV DL,'>' ; symbol of prompt 
INT 21h ; DOS call
 
END BEGIN

After compiling and linking i always get An Illegal Instruction window
Please help me

what assembler are you using? it can not be assembled with any 32-bit assembler because 16-bit MS-DOS interrupts can not be used in protected mode programs.

also the program is not complete -- it does not terminate back to the os when done but instead keeps executing random instructions that follow the end of your program. If you read some of the other programs posted here you will find some examples of a complete program.

what assembler are you using? it can not be assembled with any 32-bit assembler because 16-bit MS-DOS interrupts can not be used in protected mode programs.

also the program is not complete -- it does not terminate back to the os when done but instead keeps executing random instructions that follow the end of your program. If you read some of the other programs posted here you will find some examples of a complete program.

Thanks, I forgot to add termination lines and after i have added it began to work...
Indeed i use 32-bit TASM, interrupts seem to be OK.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.