CSE 506 Lab 3

July 24, 2017
By shp

Problem #1

Write an assembly code that will take a lowercase character input and convert it to uppercase

The code is as follows

TITLE Lower_letter_to_upper
.MODEL SMALL
.STACK 100H
.DATA
 CR EQU 0DH
 LF EQU 0AH
 MSG1 DB 'Enter the letter in lower case : $'
 MSG2 DB 0DH,0AH,'In upper case is: '
 CHAR DB ?,'$'
.CODE
MAIN PROC
 MOV AX,@DATA 
 MOV DS,AX
 
 
 LEA DX,MSG1
 MOV AH, 9
 INT 21h
 
 MOV AH,1
 INT 21h
 SUB AL,20H
 MOV CHAR,AL
 
 LEA DX,MSG2
 MOV AH,9
 INT 21h
 
 MOV AH,4CH
 INT 21H

MAIN ENDP
 END MAIN

The main segment operating the code is

 MOV AH,1
 INT 21h
 SUB AL,20H
 MOV dl,AL
 mov ah, 2
 int 21h

Problem #2

Write a program to (a) display a “?”, (b) read two decimal digits whose sum is less than 10, (c) display them and their sum on the next line, with an appropriate message.

Sample execution: 
?27 
THE SUM OF 2 AND 7 IS 9

Problem #3
Write a program to (a) prompt the user, (b) read first, middle, and last initials of a person’s name, and (c) display them duwn the left margin.
Sample execution:

ENTER THREE INITIALS: JFK 
J 
F
K

 

Submit Assignment 2 through this link

Leave a Reply

Your email address will not be published. Required fields are marked *