Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to print the message given from keyboard

Posted By: Eleanor Hughes     Category: Assembly Language     Views: 8157

Write a program to print the message given from keyboard.

Code for Program to print the message given from keyboard in Assembly Language

prnstr macro msg
    mov ah, 09h
    lea dx, msg
    int 21h
    endm

data segment
    bufo1 db "Enter a string : $"
    bufi db 11
         db 0
         db 11 dup(' ')
    bufo2 db 0ah, "You entered : $"
data ends

code segment
    assume cs:code, ds:data
start :
    mov ax, data
    mov ds, ax

    prnstr bufo1

    mov ah, 0ah
    lea dx, bufi
    int 21h

    mov si, offset bufi + 1
    mov cx, 0000h
    mov cl, byte ptr [si]
    add si, cx
    mov byte ptr [si+1], '$'

    prnstr bufo2
    prnstr bufi+2

    mov ax, 4c00h
    int 21h
code ends
    end start

  
Share: 


Didn't find what you were looking for? Find more on Program to print the message given from keyboard Or get search suggestion and latest updates.

Eleanor Hughes
Eleanor Hughes author of Program to print the message given from keyboard is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!