Vous êtes sur la page 1sur 12

Microprocessor Based Systems (CS-305) 2010-2014

Sr. #
01 02 03 04 05 06 07 08 09 10 11 12

LAB Experiments Index


Introduction to Microcomputer and Operating Systems Interacting with debug utility in Windows environment Basic Arithmetic Operations of 8086/8088 Microprocessor in Debug Mode

PAGE 2 4 7

ELECTRICAL ENGINEERING, UCET, IUB

Page 1

Microprocessor Based Systems (CS-305) 2010-2014 LAB EXPERIMENT # 01


Introduction to Microcomputer & Operating Systems
Student Name: -------------------------------------------------Lab Instructor Signature: -----------------------------------Roll No: --------------------Date: ------------------------

1) OBJECTIVE:
The objective of this experiment is to introduce the operating systems and different hardware components of a microcomputer.

2) REQUIREMENTS:
Standalone Personal Computer Operating system ( 32-bit windows XP/7, 64-bit windows with XP Mode)

3) INTRODUCTION:
Microcomputer (PC) operating systems are briefly discussed in this experiment. The two commonly used operating systems in PC are MS-DOS and Windows (95, 98,etc). In the MS-DOS environment, command line is used to view, copy or interact with stored files. In Windows environment, clicking the mouse performs these operations in a user friendly manner. First part of this experiment introduces the file management in MS DOS mode. In the second part a 386 microcomputer is disassembled and its hardware components are identified. Finally the PC is reassembled in the laboratory.

4) PRE-LAB:
Use any computer with 'Windows', to do the following operations: 1) In Windows operating system, use 'Start' and 'Find' menu to locate the 'Debug' program. Note the address or path. 2) From 'Start' and 'Programs' menu, use 'Windows Explorer' to make a new directory in C drive and name it 'MP'. 3) Using 'Copy' and 'Paste' command of 'Windows Explorer' copy the 'Debug.exe' program in to the newly created directory of 'MP' 4) Execute the 'Debug' program by clicking on it. (type 'q' to quit) 5) Also execute the 'Debug' program, from 'Start' and 'Run' menu. 6) From 'Start' and 'Programs' menu, click on 'MS-DOS prompt' to start the MS-DOS debugger. Type 'Debug' and press <enter> to execute the program. Type 'q' to quit the debug program.

ELECTRICAL ENGINEERING, UCET, IUB

Page 2

Microprocessor Based Systems (CS-305) 2010-2014


5) LAB WORK:
Use the Lab microcomputer to perform the following operations; i. ii. iii. In MS-DOS mode, C :\>' means we are in the main directory. Go to this directory and use 'DIR' to check the contents of the directory. Use 'CD' or change directory command to go to 'DOS' directory. Use 'DIR' to find Debug program in this directory (type 'DIR D* ')

ELECTRICAL ENGINEERING, UCET, IUB

Page 3

Microprocessor Based Systems (CS-305) 2010-2014 LAB EXPERIMENT # 02


Interacting with Microprocessor using Debug Utility
Student Name: -------------------------------------------------Lab Instructor Signature: -----------------------------------Roll No: --------------------Date: ------------------------

1) OBJECTIVE:
To become familiar with Debug modes or commands

2) REQUIREMENTS:
Standalone Personal Computer Operating system ( 32-bit windows XP/7, 64-bit windows with XP Mode)

3) THEORY:
Microprocessor is the main part of the CPU. It contains all the processing parts of a system like RAM, ROM, BIOS, CACHE, MEMORY ADRESSES, CACHES, REGISTERS etc. debugging utility in command prompt is the process in which we saw the location of different registers like AX, BX by using different commands. We can also move data to register now we briefly explore some different command R-command: R command is used to show the different types of registers on your microprocessor. -rax (shows the register) AX 0000 : 12ab (Assign this value to above register)

D-command :
Display command is used to display memory contents. -d 0000 (show memory contents) -d 0000 0000f (show a particular location at f)

F-command:
Fill command is used to fill the desired memory location -F 0000 0000 3C (To see the full memory location) -d 0000 0000 0B2B:0000 3C

ELECTRICAL ENGINEERING, UCET, IUB

Page 4

Microprocessor Based Systems (CS-305) 2010-2014


Mov-command:
Mov command is basically use to assign a value from one register to another register or we can say source to destination. Syntax: MOV ax, 5 This means that we assign value 5 to the register ax.

Trace command:
Trace command is used to execute your program state by state. Syntax: -t

ELECTRICAL ENGINEERING, UCET, IUB

Page 5

Microprocessor Based Systems (CS-305) 2010-2014


4) PROCEDURE:
Go to the start menu and open the command prompt. Write debug on the window now we are working in debug utility mode. Write r command t see the registers. Write d command to display memory contents. Write f command to fill the desired memory location. Terminate the program by using interrupt command.

5) CONCLUSION:
In this lab we learn how to use debug utility and functions of r, d and f commands.

6) REVIEW QUESTION:
Q.1: What is Debug utility?

Q.2:

How to access and change the contents of a general purpose register?

Q.3:

What is the command to view to view a specific memory location?

Q.4:

What command is used to fill a memory location?

Q.5:

How is a program executed in debug utility?

ELECTRICAL ENGINEERING, UCET, IUB

Page 6

Microprocessor Based Systems (CS-305) 2010-2014 LAB EXPERIMENT # 03


Basic Arithmetic & Logic Operations in Debug Utility
Student Name: -------------------------------------------------Lab Instructor Signature: -----------------------------------Roll No: --------------------Date: ------------------------

1) OBJECTIVE:
Basic arithmetic operation on 8086 microprocessor by using Debug environment

2) REQUIREMENTS:
Standalone Personal Computer Operating system ( 32-bit windows XP/7, 64-bit windows with XP Mode)

3) THEORY:
There are two types of common instructions which are used in the microprocessor in debug environment.

I.

BASIC ARITHMATIC OPERAITONS:


ADD instruction SUB instruction

Add instruction:
Add instruction is used to add source operand on which operation is performed to a destination operand and sum as stored in the destination. Program: a 0100 Mov ax,2345 % assign value to register ax mov bx,5670 % assign value to bx add ax,bx % add operation on ax,bx mov [0130],ax % save the value of ax on the given memory location int 20h % terminate the program ctr+c % come out from the program -t % trace the program state by state

ELECTRICAL ENGINEERING, UCET, IUB

Page 7

Microprocessor Based Systems (CS-305) 2010-2014

Sub instruction:
Sub instruction is used to subtract source operand (on which operation is performed to a destination operand and result is stored to destination. a 0100 mov ax,2345 % assign value to register ax mov bx,5670 % assign value to bx sub ax,bx % subtraction between ax,bx mov [0130],ax % save the value of ax on the given memory location int 20h % terminate the program ctr+c % come out from the program -t % trace the program state by state

ELECTRICAL ENGINEERING, UCET, IUB

Page 8

Microprocessor Based Systems (CS-305) 2010-2014

In the same manner use t (Trace) command to run the program step by step and the enter d 0120 0121 to display the output saved in memory location.

I.

BASIC LOGIC OPERAITONS:


AND Operation OR Operation NOT Operation

AND Operation: AND instruction is used to perform AND operation on each bit on the destination operand with the corresponding bit in the source operand.
The symbol of AND operation is given

Truth table for AND operation x y F=xy 0 0 1 1 0 1 0 1 0 0 0 1

To run this program use Trace command and finally d 0120 0121 command to display the output saved in memory. OR Operation: OR instruction is used to perform OR operation on each bit on the destination operand with the corresponding bit in the source operand.

ELECTRICAL ENGINEERING, UCET, IUB

Page 9

Microprocessor Based Systems (CS-305) 2010-2014


The symbol for OR operation is given by

Truth table for OR operation x 0 0 y 0 1 0 1 F=x+y 0 1 1 1

To run this program use Trace command and finally d 0120 0121 command to display the output saved in memory. NOT Operation: Not instruction is the logic compliment of all the bits saved in a register.
The symbol for NOT operation is given by

1 1

Truth table for NOT operation

x 0 1

F 1 0

ELECTRICAL ENGINEERING, UCET, IUB

Page 10

Microprocessor Based Systems (CS-305) 2010-2014


4) PROCEDURE:
Go to the start menu and open the command prompt. Write debug on the window now we are working in debug utility mode. Open the register 'a' and write your program. First write the program for adding the values of two registers. Second write the program to subtract the values of two register. Now we move data towards our desired memory location. We check our program state by state by using t command.

5) CONCLUSION:
In this Lab we learned basic commands for interacting with Microprocessors Registers and Primary memory. We viewed and changed the contents of different registers and Memory cells.

6) REVIEW QUESTIONS:
Q.1: What is mov instruction?

Q.2:

How to run debug utility in Windows environment?

Q.3:

What is immediate addressing mode?

ELECTRICAL ENGINEERING, UCET, IUB

Page 11

Microprocessor Based Systems (CS-305) 2010-2014


Q.4: How to mov data to two general purpose register and add their contents using immediate addressing mode?

Q.5:

What is the use of int 20h command?

ELECTRICAL ENGINEERING, UCET, IUB

Page 12

Vous aimerez peut-être aussi