You are on page 1of 5

LAB Task

Name: -
Waqar Ghafoor

Roll No: -
BCSM-F18-079

Class: -
BSCS-5A

Subject: -
Assembly Language

Submitted To: -
Sir Usman Malik
Task 1:
Define a procedure to reverse an input given by user. You can use the following algorithm:

Display a “?”
Initialize count to 0
Read a character
WHILE character is not carriage return Do
push character onto the stack
increment count
read a character
END_WHILE
Go to a new line
For count times Do
pop a character from the stack
display it
END_FOR

Solution: -

Code
Output
Task 2:
Write an assembly program that lets the user to type some text, consisting of words separated by blanks,
ending with carriage return, and display the text in the same word order as entered, but with the letters in each
word reversed. For example, “this is a test” becomes “siht si a tset”.

Solution: -

Code
Output

You might also like