Docsity

CS401 Assignment 02: Computer Architecture and Assembly Language, Exercises of Computer Architecture and Organization

Toggle sidebar
bg1
Assignment No. 02
Semester: Spring 2012
CS401: Computer Architecture and Assembly Language
Programming
Total Marks: 20
Due Date: 30 April, 2012
Instructions
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
The assignment is submitted after due date.
The submitted assignment does not open or file is corrupt.
Solution is copied from any other source.
Note: You have to upload only .doc file. Assignment in any other format (extension) will not be accepted.
Objective
The objective of this assignment is to enhance your knowledge about;
Bit Manipulation
Subroutine
Question no. 1:
(a) Assemble the following instructions and show the changes in given Accumulator register and flags
after each instruction execution. (Marks 5)
MOV AL, 8Bh ; CF = ?, SF = ?, PF = ?, ZF = ?
ADD AL, 22h ; CF = ?, SF = ?, PF = ?, ZF = ?
AND Al, 1000101b ; CF = ?, SF = ?, PF = ?, ZF = ?
OR Al, 9Ah ; CF = ?, SF = ?, PF = ?, ZF = ?
XOR AL, 10101011b ; CF = ?, SF = ?, PF = ?, ZF = ?
TEST AL, 2 ; CF = ?, SF = ?, PF = ?, ZF = ?
CMP AL, 58 ; CF = ?, SF = ?, PF = ?, ZF = ?
ADC AL, 11110000b ; CF = ?, SF = ?, PF = ?, ZF = ?
SHR AL,2 ; CF = ?, SF = ?, PF = ?, ZF = ?
docsity.com
pf2

Partial preview of the text

Download CS401 Assignment 02: Computer Architecture and Assembly Language and more Exercises Computer Architecture and Organization in PDF only on Docsity!

Semester: Spring 2012Assignment No. 02 CS401: Computer Architecture and Assembly Language Programming

Total Marks: 20 Due Date: 30 April, 2012

Instructions Please read the following instructions carefully before submitting assignment: It should be clear that your assignment will not get any credit if:The assignment is submitted after due date.The submitted assignment does not open or file is corrupt. Note: You^ ^ Solution is copied from any other source. have to upload only .doc file. Assignment in any other format (extension) will not be accepted. Objective The objective of this assignment is to enhance your knowledge about;  Bit ManipulationSubroutine

Question no. 1: (a) Assemble the following instructions and show the changes in given Accumulator register and flags after each instruction execution. (Marks 5) MOV AL, 8Bh ; CF = ?, SF = ?, PF = ?, ZF =? ADD AL, 22h ; CF = ?, SF = ?, PF = ?, ZF =? AND Al, 1000101b ; CF = ?, SF = ?, PF = ?, ZF =? OR Al, 9Ah ; CF = ?, SF = ?, PF = ?, ZF =? XOR AL, 10101011b ; CF = ?, SF = ?, PF = ?, ZF =? TEST AL, 2 ; CF = ?, SF = ?, PF = ?, ZF =? CMP AL, 58 ; CF = ?, SF = ?, PF = ?, ZF =? ADC AL, 11110000b ; CF = ?, SF = ?, PF = ?, ZF =? SHR AL,2 ; CF = ?, SF = ?, PF = ?, ZF =?

docsity.com

Question no. 1 (b): (Marks 5) Write a subroutine that can calculate the sum of an array and also save the result into DX. ( Array’s length is 20) Question no. 2 Write an assembly language code to calculate the factorial of “7” using a subroutine and also attach the final snapshot of your AFD window. ( Marks:10)

docsity.com