You are on page 1of 4

17BEC0549 Nikunj Onkar Baheti LAB Task#1

Reg no: 17BEC0549


Name: Nikunj Onkar Baheti
Lab Slot: L5+L6
Question 1: Load 40H into the stack pointer register. Load 5 data’s (8
bit data) into Bank 2. Push all the 5 data’s into the stack and retrieve
the data from stack to bank 0.
Code:

m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh

This study source was downloaded by 100000805495355 from CourseHero.com on 08-23-2021 09:08:57 GMT -05:00

https://www.coursehero.com/file/55637220/17BEC0549-VL2019201002740-AST01pdf/
17BEC0549 Nikunj Onkar Baheti LAB Task#1

Result Obtained (Debug Screen):

m
er as
co
eH w
o.
rs e
ou urc
o

Memory Window:
aC s
vi y re
ed d
ar stu
is
Th
sh

This study source was downloaded by 100000805495355 from CourseHero.com on 08-23-2021 09:08:57 GMT -05:00

https://www.coursehero.com/file/55637220/17BEC0549-VL2019201002740-AST01pdf/
17BEC0549 Nikunj Onkar Baheti LAB Task#1

Question 2: Write a program to find the average age of a group of children in


a class. There are 12 Children, ranging in age from 5 to 10 years old. Pick your
own data. Notice that you must first bring the data from ROM space into the
CPU's RAM and then add them together. Using KEIL simulator, simulate to get
the results in BCD.

Code:

m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh

This study source was downloaded by 100000805495355 from CourseHero.com on 08-23-2021 09:08:57 GMT -05:00

https://www.coursehero.com/file/55637220/17BEC0549-VL2019201002740-AST01pdf/
17BEC0549 Nikunj Onkar Baheti LAB Task#1

Results Obtained (Debug Screen):


Data taken: 5,5,5,5,6,6,6,6,6,7,7,7

m
er as
co
eH w
o.
rs e
ou urc
o
aC s

Register Window:
vi y re

Total Sum: 71
ed d
ar stu

Quotient of Average (Stored in A in BCD) = 5


Remainder of Average (Stored in B in BCD) = 11
is
Th
sh

This study source was downloaded by 100000805495355 from CourseHero.com on 08-23-2021 09:08:57 GMT -05:00

https://www.coursehero.com/file/55637220/17BEC0549-VL2019201002740-AST01pdf/
Powered by TCPDF (www.tcpdf.org)

You might also like