1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

assembly interrupt 10h

Discussion in 'Software Development' started by punjabian263, Apr 10, 2004.

Thread Status:
Not open for further replies.
  1. punjabian263

    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
    
     
  2. punjabian263

    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
     
    
     
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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/218940

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice