Cs401 Assignment Fall 2016
Here is the Cs401 Assignment no. 1 Solution and Discussion. Due date 14 nov 2016.Computer Architecture and Assembly Language Programming (CS401). Solution has been added below:Cs401 Assignment no. 1:
Assignment # 01
Total marks = 20
Total marks = 20
Cs401 Assignment no.1 Deadline Date:
14th of November, 2016
Download Assignment: Fall 2016_CS401_Assignment_1.doc
Please carefully read the following instructions before attempting assignment.
14th of November, 2016
Download Assignment: Fall 2016_CS401_Assignment_1.doc
Please carefully read the following instructions before attempting assignment.
You should Also Read:
ENG101 Assignment No 1 Solution Fall 2016MTH202 Assignment No 01 2016 - Solution
MGT101 Assignment No 01 Fall 2016
CS101 Assignment No. 01 Fall 2016 - Introduction To Computing
STA301 Assignment No.1 Solution 2016
CS401 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 in CS401 Assignment:
RegistersIntel Architecture
Register Architecture
Data Declaration
Addressing Modes
CS401 Assignment important 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
CS401 Assignment Questions No 01
Marks: 10
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
CS401 Assignment Questions No 02 :
Marks: 10
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.
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.
CS401 Assignment Solution:
CS401 Assignment Questions No 01 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
CS401 Assignment Questions No 02 Solution:
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
Download CS401 Assignment#01 Solution
Don’t wait for Solution post your problems in Comments Below and discuss after discussion a perfect solution will come in a result.
(correct me if i am wrong)
ReplyDelete[org 0×0100]
mov ax,0 initializing ax as zero 0
mov bx,0 : initializing bx as zero 0
mov ax,[num1] : move num1 into ax
mov bx,[num2] : move num2 into bx
add ax,bx : add bx into ax
mov bx,[num3] : move [num3] into bx
add ax,bx : add bx into ax
mov[num4],ax : store sum in num4
mov ax × 0x4c00 ; terminate program
int 0×21
num1 ; dw 04
num2 ; dw 08
num3 ; dw C
num4 ; dw 0
my solution for question no 1:
ReplyDelete[org 0×0100]
mov ax,0
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 04 h
Num2: dw 08 h
Num3: dw C h
Num4: dw 00 h