assembly interrupt 10h

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

punjabian263

Thread Starter
Joined
Mar 13, 2003
Messages
358
hello guys,
I am using int video interrupt 10h to display a string hello world, but problem is it runs infinit loop and
terminate with error message, cpu encountered an illegual operation... will close.
here is main proc
Code:
.model compact
.stack 100h
.data
msg    DB  'Hello World!', 0   ; null terminated string.
.code
main proc
mov ax,@data
mov ds,ax
mov bh,0
CALL   printstring
mov ah,4ch
int 20
main endp
 

punjabian263

Thread Starter
Joined
Mar 13, 2003
Messages
358
code of procedure printstring

Code:
printstring     PROC
mov si,offset msg	;moves offset of string defined in .data
next_char:		;label
    CMP  [SI], 0    ; check for zero to stop
    JE   stop         ;
    MOV  AL, [SI]     ; next get ASCII char.
    MOV  AH, 0Eh      ; teletype function number.
    INT  10h          ; using interrupt to print a char in AL.
    inc si            ; advance index of string array.
    JMP  next_char    ; go back, and type another char.
stop:
RET                   ; return to caller.
printstring     ENDP
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top