Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS401 Computer Architecture and Assembly Language Assignment No.2 Fall 2012
#1




CS401 Computer Architecture and Assembly Language Assignment No.2 Fall 2012


Assignment No. 02
Semester: Fall 2012
CS401: Computer Architecture and Assembly Language Programming
Total Marks: 20

Due Date:26 Nov,2012

Due Date:
Your assignment must be uploaded/submitted before or on 26 November 2012

Uploading instructions:

Please view the Assignment Submission Process document provided to you by the Virtual University for uploading assignments.

• Assignment should be in .doc format.
• Save your assignment with your ID (e.g. bx020200786.doc).
• Assignment submission through email is highly discouraged.

Rules for Marking:

It should be clear that your assignment will not get any credit if:
• The assignment is submitted after due date.
• The submitted assignment file is corrupted.
• The assignment is copied.
Note:
Your answer must follow the below given specifications. You will be assigned zero marks if you do not follow these instructions.
o Font style: “Times New Roman”
o Font color: “Black”
o Font size: “12”
o Bold for heading only.
o Font in Italic is not allowed at all.
o No formatting or bullets are allowed to use.

Objective
The objective of this assignment is to enhance your knowledge about;

 Subroutines
 How to execute Subroutine Program


Assignment No. 2

Question No. 1:

Assemble the given Subroutine program using NASM (Netwide Assembler) to add 10 numbers array using a subroutine named as “sumofarray” and show the changes occurs in AX, BX & CX on each step.

(10 marks)
[ORG 0x0100]

MOV BX, VAL
MOV CX, 3
MOV AX, 0

CALL SUMOFARRAY

MOV AX, 0X4C00
INT 0X21

SUMOFARRAY: ADD AX, [BX]
ADD BX, 2
SUB CX, 1
JNZ SUMOFARRAY
MOV [SUM], AX
RET

VAL: DW 30,40,50
SUM: DW 0

Note: Execute this program with F2 key (instruction will move one by one) and using F1 key is used to trace the call subroutine. Write down the contents of the specified registers in the given table.

Instruction Register current value after the instruction execution IP
(Instruction Pointer) Flags
CF ZF PF SF AF
1 [ORG 0x0100] AX
BX
CX
2 MOV BX, VAL AX


BX
CX
3 MOV CX, 3 AX
BX
CX
4 MOV AX, 0 AX
BX
CX
5 CALL SUMOFARRAY
6 MOV AX, 0X4C00
7 INT 0X21
8
SUMOFARRAY:

ADD AX, [BX] AX
BX
CX
ADD BX, 2 AX
BX
CX
SUB CX, 1 AX
BX
CX
9
SUMOFARRAY:

ADD AX, [BX]
AX

BX
CX
ADD BX,2 AX
BX
CX

SUB CX,1 AX
BX
CX

10
SUMOFARRAY:

ADD AX, [BX]
AX
BX
CX
ADD BX,2 AX
BX
CX

SUB CX,1 AX
BX
CX
11 MOV [SUM], AX AX
BX
CX


Question No. 2:


After attempting previous question, you are now able to write, assemble and debug a Subroutine program. Write an assembly language code to find the minimum number from an array of ten numbers using a subroutine. Explain each instruction of program in your own words and also attach the snapshot of your AFD (A Fullscreen Debugger) showing the executed code of final results.
(10 marks)

(Program using subroutine: 5 marks, Explanation: 3 marks, Snapshot: 2 marks)

Note: Provide snapshot of your program which will be run in AFD window. It is strictly prohibited the copied assignment.


Attached Files
.doc   Fall2012_CS401_2.doc (Size: 217.5 KB / Downloads: 251)

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,324 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,912 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,931 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,168 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,247 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,970 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,667 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,807 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,702 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,800 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)