We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>
+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion
How to Add New Discussion in Study Group ? Step By Step Guide Click Here.
Computer Architecture and Assembly Language Programming (CS401)
Assignment # 01
Total marks = 20
Deadline Date
14th of November, 2016
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.
You should consult the recommended books to clarify your concepts as handouts are not sufficient.
You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.
Topic Covered:
Registers
Intel Architecture
Register Architecture
Data Declaration
Addressing Modes
NOTE
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 closing date.
If you people find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.
For any query, feel free to email at:
cs401@vu.edu.pk
Questions No 01 10 marks
Write a complete assembly language code for the following pseudo code:
Initialize a variable named NUM1 with 04 as a Hexadecimal Number
Initialize a variable named NUM2 with 08 as a Hexadecimal Number
Initialize a variable named NUM3 with 12 as a Hexadecimal Number
Initialize a variable named NUM4 with 00 as a Hexadecimal Number
Initialize AX with zero 0
Initialize BX with zero 0
Move NUM1 into AX
Move NUM2 into BX
Add BX into AX
Move NUM3 into BX
Add BX into AX
Store AX into NUM4
Questions No 02 10 marks
Suppose, we have the following register values:
AX
0150
BX
AB5D
CX
FF0A
DX
1234
DS
CC20
CS
EF10
ES
225F
SS
E25F
SI
1212
SP
CD0F
BP
95F8
DI
BDEF
You are required to calculate the physical address generated by each of the following instructions.
ADD [bx+Di], CX
MOV DX, [SP+1652H]
Note: Each provided instruction is independent.
Tags:
+ How to Follow the New Added Discussions at Your Mail Address?
+ How to Join Subject Study Groups & Get Helping Material? + How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators? + VU Students Reserves The Right to Delete Your Profile, If?.
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)its wrong i think
ans i main EA=1694c PA main 0110 kese?
Q 1: Write a complete assembly language code for the following pseudo code:
Initialize a variable named “NUM1” with “04 as a Hexadecimal Number”
Initialize a variable named “NUM2” with “08 as a Hexadecimal Number”
Initialize a variable named “NUM3” with “12 as a Hexadecimal Number”
Initialize a variable named “NUM4” with “00 as a Hexadecimal Number”
Initialize AX with zero “0”
Initialize BX with zero “0”
Move NUM1 into AX
Move NUM2 into BX
Add BX into AX
Move NUM3 into BX
Add BX into AX
Store AX into NUM4
Solution :
[org 0x0100]
mov bx, 0
mov ax ,[num1]
mov bx ,[num2]
add ax, bx
mov bx, [num3]
add ax, bx
mov [num4], ax
mov ax, 0x4c00
Int 0x21
num1: dw 4
num2: dw 8
num 3: dw 12
num 4: dw 00
Questions No 02 10 marks
Suppose, we have the following register values:
AX 0150
BX AB5D
CX FF0A
DX 1234
DS CC20
CS EF10
ES 225F
SS E25F
SI 1212
SP CD0F
BP 95F8
DI BDEF
You are required to calculate the physical address generated by each of the following instructions.
ADD [bx+Di], CX
MOV DX, [SP+1652H]
Note: Each provided instruction is independent.
Solution:
Answer i:
Effective Address EA= Base +Index +Offset
=0x AB5D +0x BDEF +0x0000
=0x 1694c
Physical Address = segment*0x10+Effective Address
= 0x000*0x10+0x0110
=0x120
ANSWER ii:
Effective Address EA = Base + Index + Offset
=0x AB5D + 0x000 +0x1652
=0xC1AF
Physical Address = segment * 0x10 + Effective Address
= 0x0000 * 0x10 + 0xc1AF
=0xC1BF
Please see page no. 26 for clear answer of question No. 1 only change is that value of 12 regarding hex is 18.
For second question u can only addition of segment register and offset where bx, di, sp and 1652h all are offset and segment registers are ds, es, ss and ds are respectively...
furthermore for addition we may be added 0 at the end of segment and at the start of offset....
thnks
CS401 Assignment#01 Solution
exactly.. i think it is wrong.. should be 1704
please koi chek kr k batao mera ye solution theak ha kai dono questions k answers theak ha ya ni.
Can we add SP and 1652H???? I think offset is of 20bit it can't be added.
help anyone.
© 2019 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
VU Students reserves the right to delete profile, which does not show any Activity at site nor has not activity more than 01 month.
We are user-generated contents site. All product, videos, pictures & others contents on vustudents.ning.com don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com or Contact us at contact Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post