Anda di halaman 1dari 24

Department of Computer Science

CSC-210 Computer Organization and Assembly Language


Laboratory Manual

Computer Organization and Assembly Language


CSC-210

Laboratory Manual

1
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab # Title page


Lab(1) Computer Anatomy 2

Lab(2) Memory and ports 4

Lab(3) Motherboard and cards 6

Lab(4) Numbering systems 9

Lab(5) Registers types 11

Lab(6) Loading the DEBUG Program 12

Lab(7) Assembly basic Instructions part (1) 13

Lab(8) Assembly basic Instructions part (2) 14

Lab(9) Assembly basic Instructions part (3) 15

Lab(10) Execution Assembly Instructions(1) 17

Lab(11) Execution Assembly Instructions(2) 18

Lab(12) Execution Assembly Instructions(3) 19

Lab(13) Assembly logic operation Instructions 21

1
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (1): Computer Anatomy

Objectives

 Identify the basic components of computer and their working


 Explain the importance of various units of a computer

Question (1): What are the four basic functions of performed by the computer?

1-
2-
3-
4-

Question (2): Choose the correct answer?

(a) The task of performing arithmetic and logical operation is performed by .


(i) ALU (ii) Editor (iii) storage (iv) output

(b) The ALU and CPU are jointly knows as


(i) RAM (ii) ROM (iii) CPU (iv) none of the above

(c) The process of producing results from the data for getting useful information is
called?
(i) Output (ii) input (iii) processing (iv) storage

2
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (3):

(a): List four input devices?


1-
2-
3-
4-

(b): List four input devices?


1-
2-
3-
4-

Question (4): What are the major components of computer?


1-
2-
3-
4-

Question (5): What is CPU and how does it work? Explain briefly?

------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------

Question (6): What are the four basic functions performed by the computer?

------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------

3
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (2): Computer Anatomy part (2)


)Memory and ports)

Objectives
 Identify the ports computer and their working.
 Explain the importance types of memory and ports.

Question (1): Fill the tables below by write the suitable ports?

A):

B)

C(

4
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (2): Differentiate between the following:

(a) RAM and ROM

------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------

(b) DRAM and SRAM

------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
Question (3):

a. Distinguish between bit and byte?

b. Define volatile and non-volatile memory?

Question (4): Write True or False?


(a) There are two kinds of computer memory: primary and secondary.
(b) The computer can understand decimal system also.
(c) The storage of program and data in the RAM is permanent.
(d) PROM is secondary memory.
(e) The memories which do not lose their content on failure of power
Supplies are known as non-volatile memories

5
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (3): Computer Anatomy part (3)


)Motherboard and cards)

Objectives
 Identify the components computer and their functions.
 Explain the importance types of mother board.

Question (1): write the parts names of motherboard?

6
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (2): Fill in the blanks?

(a) .................. unit coordinates the activities of all the other units in
The system.

(b) The standard size of display screen is .............. Lines by ...........


Characters.

Question (3): What is Hard Disk?

Question (4): Write Performance parameters of hard disk?

1-

2-

Question (5): What’s a Graphics Card?


-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------

7
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (6):

a- What is it? - Basic Input Output System


-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------

b- Why is it necessary?
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------

C- List the important Functions of Basic Input Output System?

-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------

Question (7): Define the following?

a- Sound Card
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------

b- Network Interface Card

-------------------------------------------------------------------------------------
------------------------------------------------------------------------------------

8
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (4): Numbering systems

Objectives
 Review and explain the importance types of numbering systems types.
 Explain the basic operations performed on numbers.

Question (1): find the 1st and 2nd complement of the following decimal values?

a) 154
b) – 413

Question (2):

1. What is the 3-digit 10’s complement of 247?


a. Answer:

2. What is the 3-digit 10’s complement of 17?


a. Answer:

3. 777 is a 10’s complement representation of what decimal value?


a. Answer:

4. What is -20 expressed as an 8-bit binary number in 2’s complement notation?


a. Answer:

5. 1100011 is a 7-bit binary number in 2’s complement notation. What is the


decimal value?
a. Answer:

9
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (3):

I-Add 010011112 to 001000112 using signed-magnitude arithmetic.

II-Add 100100112 (–19) to 000011012 (+13) using signed-magnitude arithmetic.

Question (4):
I-Subtract 010011112 to 011000112 using signed-magnitude arithmetic

II-Subtract 011000112 (99) from 010011112 (79) using signed magnitude arithmetic

III-Subtract 100110002 (–24) from 101010112 (–43) using signed-magnitude arithmetic.

Question (5):

I-Express 2310 and 910 in 8-bit binary one's complement form.

II-Add 2310 to –910 using one's complement arithmetic.

III-Express 2310, –2310, and –910 in 8-bit binary two's complement forms.

IV-Add 910 to –2310 using two's complement arithmetic

Question (7):
(a) The 2s complement of (01010)2 is

(b) The 2s complement of (0.0010)2 is

(c) The 10s complement of (4887)10 is

(d) The 10s complement of (48.87)10 is

11
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (5): Registers types


Objectives

 Identify computer registers and there functions

Question (1): List types of data registers?

1-
2-
3-

Question (2): List types of Sections Registers?

1-
2-
3-

Question (3): What are the Differences between AH & AX?

------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------

11
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (6): Loading the DEBUG Program

Objectives
 Explain Loading the DEBUG Program.

Part 1:

Start Emu8086 by selecting its icon from the start menu, or by running
Emu8086.exe.
2. Select "Samples" from "File" menu.
3. Click [Compile and Emulate] button (or press F5 hot key).
4. Click [Single Step] button (or press F8 hot key), and watch how the cod
is being executed.
5. Try opening other samples, all samples are heavily commented, so it's a
great learning tool.

Part 2: Examining and Modifying the Contents of the 80x86's


Internal Registers

1. Use the REGISTER command to display the current contents of all of the
80x86's internal registers. List the initial values held in CS, DS, and SS.
_____________ ,_____________ ,______________

2- Here is a short program that demonstrates the use of MOV instruction:

#MAKE_COM# ; instruct compiler to make COM file.


ORG 100h ; directive required for a COM program.
MOV AX, 0B800h ; set AX to hexadecimal value of B800h.
MOV DS, AX ; copy value of AX to DS.
MOV CL, 'A' ; set CL to ASCII code of 'A', it is 41h.
MOV CH, 01011111b ; set CH to binary value.
MOV BX, 15Eh ; set BX to 15Eh.
MOV [BX], CX ; copy contents of CX to memory at B800:015E
RET ; returns to operating system.

12
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (7): Assembly basic Instructions


Objectives

 Identify Assembly basic Instructions


MOV,XCHG

Question (1) : Write the syntax of MOV,XCHG?

Question (2): Explain the following statements?


1- MOV AX,word
2- MOV AL,'A'

Question (3): Explain the following statements?

1- XCHG AH,BL
2- XCHG AX,WORD

Question (4): Save the Value of A in B

Question (5): Find the error and rewrite the statements?

1-MOV DS,1000
2- MOV DS,ES

13
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (8): Assembly basic Instructions

Objectives 
 Identify Assembly basic Instructions
ADD,SUB

Question (1) : Write the syntax of ADD,SUB?

Question (2) : Write assembly Instructions for the following statements

1- A= 5 – A

Question (3): Write assembly Instructions for the following statements

1- A=B-2*A

Question (4): Fill the Blanks in the Following:


Assume
A=15
B=6
 MOV AX , A (AX= )
 SUB AX , B (AX= )
 MOV A , AX (A= )

14
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (9): Assembly basic Instructions

Objectives

 Identify Assembly basic Instructions.

SUB,DIV,DEC,INC 

Question (1) : write the outputs of the following ?

A- MOV DH,41H
ADD DH,3

B- MOV AL , 6
MOV CL , 8
ADD AL , CL

Question (2) :write a program to execute the following statement

CL=2*AL+BL

15
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (3): write the outputs of the following?

MOV AL , 8
MOV CL , 6
SUB AL , CL

Question (4) :write a program to execute the following statement

120/12H

16
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (10): Execution Assembly Instructions


Objectives
Learn how to execute Assembly instructions and observe the results

Question (1) : Encode each of the instructions that follow into machine code.

a. MOVAX,BX _______________
b. MOV AX, OAAAA _______________
c. MOV AX, [BX] _______________
d. MOV AX, [0004] _______________
e. MOV AX, [BX + SI] _______________
f. MOV AX, [SI+4] _______________
g. MOV AX, [BX + SI +4] _______________

Question (2): write the outputs of the following?

MOV AX, 5 ;
ADD AX, 3 ;,
INC AX ;
DEC AX ;
SUB AX, 6 ;

17
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (11): Execution Assembly Instructions

Question (1)

Procedure
1. Initialize the internal registers of the 80x86 as follows:
(AX) = 0000H (BX) =
0001H

2. Initialize the word storage locations in the memory as follow:


(DS: 0001H) = BBBBH
(DS: 0004H) = CCCCH
3. Enter the following Assembly instructions at the current CS:IP

MOV AX, BX
MOV AX, OAAAA
MOV AX, [BX]
MOV AX, [4]
ADD AX, BX

18
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Step1 1Data transfer instructions Using emu8086 to assemble the instructions


(a) MOV AX,BX
(b) MOV AX,0AAAAh
(c) MOV AX,[BX]
(d) MOV AX,[4]
(e) MOV AX,[BX+SI]
(f) MOV AX,[SI+4]
(g) MOV AX,[BX+SI+4]
Step 2 Initializing the internal registers of the 80x86
as follows:
(AX) = 0000H
(BX) = 0001H
(CX) = 0002H
(DX) = 0003H
(SI) = 0010H
(DI) = 0020H
(BP) = 0030H
(DS) = 0B60H
Verify the initialization by displaying the new
content of registers
Step 3 Fill all memory locations in the range DS:00
through DS:1F with 00H and then initialize
the following storage locations:
(DS:0001H) = BBBBH
(DS:0004H) = CCCCH
(DS:0011H) = DDDDH
(DS:0014H) = EEEEH
(DS:0016H) = FFFFH
Step 4 Trace the execution of the instructions (a)
through (g). Explain the execution of each
instruction, including addressing mode,
physical address for memory addressing
mode, value in AX. Fill the table below.

Question (2): fill the following table?

Addressing Physical
Instruction AX Function
Mode Address
a
b
c
d
e
f

19
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (12): Execution Assembly Instructions

Question (1) Write a program to add two numbers of length 16 bits stored in
memory in positions 02000h, 0202h?

Question (2): Suppose AL= 35H BL= 39H write program to add the numbers and
correct the result?

Question (3): Suppose [2f018h] =0400h DS=2f00h SI=0018h write program to


subtract 03f8h From [SI]?

Question (4): write program to divide two numbers 9/4?

21
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Lab (13): Assembly logic Operation

Identify Assembly basic operation Instructions.

OR, AND, Test, XOR, NOT

Question (1) : Fill the following table ?

A B A+B
1 1
1 0
0 1
0 0

Question (2) : find the value of registers OR AL , BL ,suppose AL= 2FH, BL=52H
?
AL
BL
OR AL,BL

Question (3) : Fill the following table?

A B A.B
1 1
1 0
0 1
0 0

21
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (4): find the value of registers AND AL , BL ,suppose AL= 27H,
BL=56H ?
AL
BL
AND
AL,BL

Question (5) : Fill the following table?

A B Test A,B
1 1
1 0
0 1
0 0

Question (6) : Find the value of registers TEST AL , BL ,suppose AL= 27H,
BL=56H ?

AL
BL
TEST
AL,BL

22
Department of Computer Science
CSC-210 Computer Organization and Assembly Language
Laboratory Manual

Question (7) : Fill the following table ?

A B A XOR B
1 1
1 0
0 1
0 0

Question (8) : Find the value of registers XOR AL , BL ,suppose AL= 7H,
BL=76H ?

AL
BL
XOR AL,BL

Question (9) : Fill the following table ?

A NOT A
1
0

23

Anda mungkin juga menyukai