Sunday, 14 June 2015

Read First,Middle,and Last Initials Of a Person's and Display Down Tham In Assembly Language Solution.

Write a program to (a) prompt the user,(b) read first,middle,and last initials of a person's,and (c) 
display down the left margin in assembly language

Sample Execution:
ENTER THREE INITIALS: JFK
J
F
K

/*
    *
    * Prosen Ghosh
    * American International University - Bangladesh (AIUB)
    *
*/

Solution:

.model small
.stack 100h
.data
str db 'ENTER THREE INTIALS: $'
newline db 0Ah,0Dh
fname db ?
newline1 db 0Ah,0Dh
mname db ?
newline2 db 0Ah,0Dh
lname db ?
finish db '$'
.code

main proc
 
    mov ax,@data
    mov ds,ax
 
    mov ah,9
    lea dx,str
    int 21h
 
    mov ah,1
    int 21h
    mov fname,al
 
    int 21h
    mov mname,al
           
    int 21h
    mov lname,al
 
    mov ah,9
    lea dx,newline
    int 21h
 
    mov ah,4ch
    int 21h 

    main endp
end main

No comments:

Post a Comment