# assembly interrupt 10h



## punjabian263 (Mar 14, 2003)

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

```
.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 (Mar 14, 2003)

code of procedure printstring


```
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
```


----------

