Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Write a program to (a) prompt the user, (b) read first, middle, and
- ; last initials of a person's name, and (c) display them down the
- ; left margin.
- ; Sample execution:
- ; ENTER THREE INITIALS: JFK
- ; J
- ; F
- ; K
- .MODEL SMALL ; IN THIS COURSE ALL MODEL ARE SMALL
- .STACK 100H ; WE ALWAYS USE STACK 100H
- .DATA ; DATA SEGMENT
- STR DB 'ENTER THRRE INITIALS: $' ; to print the line we store it on STR
- STR1 DB '',0AH,0DH ; we give new line
- FIRST DB ? ; here we take a variable where we first number
- STR2 DB '',0AH,0DH ; here also we give a new line
- SECOND DB ? ; here we take a variable where we second number
- STR3 DB '',0AH,0DH ; here also we give a new line
- THIRD DB ? ; here we take a variable where we third number
- STR4 DB '$' ; here we use $ to end the string
- .CODE ; main code start here
- MAIN PROC
- ;PROGRAMME SEGMENT PREFIX
- MOV AX,@DATA
- MOV DS,AX ; INITILATION OF DS
- MOV AH,9 ; the function will use to print string
- LEA DX,STR ; this print the str value
- INT 21H ; make this computer to do
- MOV AH,1 ; this will use to take input
- INT 21H ; make this work to get input
- MOV FIRST,AL ; this will take 1st input and store it on first variable
- INT 21H ; make computer to do this
- MOV SECOND,AL ; this will take 1st input and store it on second variavle
- INT 21H ; make computer to do this
- MOV THIRD,AL ; this will take 1st input and store it on third varible
- MOV AH,9 ; the function will use to print string
- LEA DX,STR1 ; this print the str1 value
- INT 21H ; make computer to do this
- MOV AH,4CH ; TERMINATED THE CODE AND EXI
- INT 21H
- MAIN ENDP
- END MAIN
Add Comment
Please, Sign In to add comment