CSE 322 Fall 2018 Lab 2

October 2, 2018

Problem #1

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

//Solution
mov ah, 1
int 21h
mov bl, al
int 21h
mov bh, al
int 21h
mov cl, al 

mov ah, 2
mov dl, 0dh
int 21h
mov dl, 0ah
int 21h 
mov dl, bl
int 21h 
mov dl, 0dh
int 21h
mov dl, 0ah
int 21h 
mov dl, bh
int 21h
mov dl, 0dh
int 21h
mov dl, 0ah
int 21h 
mov dl, cl
int 21h

Problem #2

Write a program to draw a 5*5 solid box of star.

Sample Execution






//Solution
.MODEL small
.STACK 100h
.DATA
str db '*****', 0dh, 0ah,'$'
.CODE
MAIN PROC
mov ax, @data
mov ds, ax 
mov ah, 9
lea dx, str
int 21h
int 21h
int 21h
int 21h
int 21h 
ENDP MAIN 
end MAIN

Problem #3

Write a program to draw a 5*5 hollow box of stars

Sample Execution


*     *
*     *
*     *


//Solution
To be done by students

Problem #4

Write a program that will (a)take three initials as input and (b) embedd them in a 5*5 box of stars

Sample Execution
ABC


A
B
C


//Solution
To be done by students

Problem #5

Write a program to take a hexadecimal, A-F as input and print its equivalent decimal in the next line.

Sample Execution
A-10
B-11
C-12
E-13

//Solution
To be done by students

Leave a Reply