hello guys,
I am using int video interrupt 10h to display a string hello world, 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,
@datamov ds,ax
mov bh,0
CALL printstring
mov ah,4ch
int 20
main endp
[/code]
Comments
[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
[/code]
:
: hello guys,
: I am using int video interrupt 10h to display a string hello world, 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 [red]I believe the exit function is 21h, not 20t[/red]
: main endp
: [/code]
: