eee316 exp01

4

Click here to load reader

Upload: musbiha-binte-wali

Post on 12-Jul-2015

51 views

Category:

Education


0 download

TRANSCRIPT

Page 1: eee316 exp01

Department of Electrical and Electronic Engineering

Bangladesh University of Engineering and Technology

Course No.: EEE 316 Group No.: 05

Course Name: Microprocessor and Interfacing Sessional.

Experiment No.: 01

Experiment Name:

Basic idea of microprocessors and interfacing devices.

Assembly language introduction and elementary commands.

Date of Performance: 19/11/2013 Name: Musbiha Binte Wali

Date of Submission: 26/02/2013 Level: 3 Term: 2

Section: A1

Student No.: 0906022

Page 2: eee316 exp01

Objective: The objective of this experiment is to be familiarized with microprocessor trainer and loading some simple programs in the kit.

Task: To write complete assembly language for the operation of finding out n-th Fibonacci number

Code:

CODE SEGMENT ASSUME CS:CODE, DS:CODE

; ORG 1000H

; MAIN: MOV AX, CS MOV DS, AX

; MOV CX,n ;n is the index of the fib no.

beginloop: MOV AX,DATA1

ADD AX,DATA2 MOV BX,DATA2

MOV DATA2,AX MOV DATA1,BX ;DATA1 is n-th fib no.

loop beginloop ;

MOV AH, 4CH INT 21H

; ORG 2000H

n DW 8H ORG 2030H DATA1 DW 0H

ORG 2070H DATA2 DW 1H

; CODE ENDS

END

END MAIN

Page 3: eee316 exp01

Results:

In each debugging, n’s value is at 1414:2000.

n-th Fibonacci number is at 1414:2030

For n=6

For n=7

Page 4: eee316 exp01

For n=8

For n=9