Computer Architecture and Assembly language programming (CS401)
Assignment # 1
Total marks = 20
Deadline Date = April 25, 2013
Please carefully read the following instructions before attempting assignment.
Rules for Marking
It should be clear that your assignment would not get any credit if:
- The assignment is submitted after the due date.
- The submitted assignment does not open or file is corrupt.
- Strict action will be taken if submitted solution is copied from any other student or from the internet. Students will be punished severely in either case.
1) You should concern recommended books to clarify your concepts as handouts are not sufficient.
2) You are supposed to submit your assignment in .doc format. Any other formats like scan images, PDF, zip, rar, bmp etc will not be accepted.
3) You are advised to upload your assignment at least two days before the due date.
4) The assignment file comprises of two pages.
Note:
Assignment comprises of lectures No. 1-7.
No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its deadline.
For any query, feel free to email at:
Question No. 1: Marks [5+5]
Calculate physical address for the following segment-offset pairs:
Solution:-
A) 5FD1: 111E
-
Segment Address = 5FD1 x 10 = 5FD10
-
Offset Address = 111E
-
Physical Address = 5FD10 + 111E =61E2E
-
B) 91EF: F1F1
-
Segment Address = 91EF x 10 = 91EF0
-
Offset Address = F1F1
-
Physical Address = 91EF0 + F1F1 = A2201
Briefly explain each step.
Question No. 2: Marks [10]
Write a complete assembly language code for the following program:
- Initialize AX with ‘4’
- Move ‘9’ to BX
- Move ‘6’ to CX
- Add AX with BX and store the result in AX
- Subtract CX from BX and store the result in BX
- Add AX with BX and the store the result in DX
- Invert the contents of AX register
- Perform AND operation on AX and DX registers; store the result in BX register.
Solution:-
- mov ax, 4;
- mov bx, 9;
- mov cx, 6;
- add ax, bx;
- sub bx, cx;
- add dx, ax, bx;
- MVN ax; Not sure…..
- Not sure…..
Best of luck!
A.A Your answers are athentic.i m glad to use this site.great team work…