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


CS401 Computer Architecture and Assembly Language Programming Assignment No.1 Semester Fall 2012



Assignment No. 01
Semester: Fall 2012

CS401: Computer Architecture and Assembly Language Programming

Total Marks: 20

Due Date:12 Nov,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;
Physical address calculation
Branching Techniques

Assignment


Question No. 1: (10 mark)



Part (A):

Calculate physical address of the following segment offset pairs. Explain each and every step for calculating the physical address. (Calculation:3 marks, Explanation:2 marks)

2C3E:0199
8000:0250


Part (B):

Assemble the given program using NASM.

(5 marks)

ORG 0100H

MOV AX,5H

ADD AX,44ABH

MOV BX,10

ADD AX,BX

SUB AX,0F12H

MOV BX,15

ADD AX,BX

MOV AX,0X4C00

INT 0X21

After that load the Debugger by typing AFD in the command prompt like in Fig 1.

Fig 1: Loading debugger.

The AFD window will be opened. The complete description is given below in fig 2

Fig 2: AFD description.


When the program is loaded in the debugger, it is loaded at offset 0100, which displaces all memory accesses in our program. Execute the program step by step and examine how the memory is read and the registers are updated, how the instruction pointer moves forward.
Now we execute the program with F2 key (instruction will move one by one) and 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 0100H

AX

BX

2

MOV AX,5H

AX

BX

3

ADD AX,44ABH

AX

BX

4

MOV BX,10

AX

BX

6

ADD AX,BX

AX

BX

7

SUB AX,0F12H

AX

BX

8

MOV BX,15

AX

BX

9

ADD AX,BX

AX

BX


Table: Register contents after the execution of each instruction.

Question No. 2: (10 mark)

Now after attempting previous question, You are able to write, assemble and debug a program. So write a program using Conditional Jump instructions that will add all odd numbers between 1 to 20 (not including 1 & 20). Explain each instruction of program in your own words and also attach the snapshot of your AFD showing the executed code results.

(Program:5 marks, Explanation: 3 marks & Snapshot: 2 marks)

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,319 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,904 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,924 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,159 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,237 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,962 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,658 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,792 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,695 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,793 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)