F20 21 Eeng410 QZ2 Sol
F20 21 Eeng410 QZ2 Sol
F20 21 Eeng410 QZ2 Sol
Name:
St. No:
EENG410/INFE410 – Microprocessors I
Quiz #2 (04 January 2021)
1.) Write an assembly language program to clear the top 5 rows of the top right quarter of the screen
and display your name at the top right corner of this region. The program further clears the left
bottom quarter and displays the surname in reverse order at the middle of this quarter.
Hints: - INT 10H, AH= 06 scroll up window (clear) with CX to be left top corner and DX to be right bottom corner.
- INT 10H, AH= 02 sets cursor location and assumes row in DH and column in DL.
- INT 21H, AH= 09 displays the string on the screen.
- INT 21H, AH= 02 outputs a character to the monitor. Assumes the character in DL (ASCII)
1
2. Given an example of data segment below:
.DATA
X DB +21, -76, +74, -99, -32, -89, -43, -121, +15, -112, +76, -17
S DB 12
P DB ?
N DB ?
Write the definition of a macro which calculates the average of the positive and negative signed
numbers in array X respectively. The macro has 4 arguments. First two arguments are name (X)
and size (S) of the array. Last two arguments are the averages of the positive (P) and negative (N)
signed numbers. The macro ignores the remainders.