Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Design and Implementation of an Assembly Program Based on what you have learned so far, design and implement a program that completes the following

image text in transcribed
3. Design and Implementation of an Assembly Program Based on what you have learned so far, design and implement a program that completes the following task Suppose you went to a book store and you bought 4 EE books with the prices of 102, 93, 87 and 95 respectively; 3 CpE books with the prices of 95, 92 and 89 respectively; 2 math books with the prices of 88 and 96 respectively. Please design a program to calculate the average price of all the books, i.e. (102+93+87+95+95+92+89+88+96 (4+3+2). Please design your program such that you will use all of the following addressing modes in your code: inherent addressing mode; immediate addressing mode (ex.: for the book prices); index addressing mode (ex.: for saving the book prices into memory) and extended addressing mode (ex.: for storing the results). Notice the numbers used in the above equation are decimal mumbers. Please also note that the addition of multiple 8-bit numbers may result in a large mumber out of the range of an 8-bit mumber. In this case, 16-bit addition instruction can be used, for example, ABX (or ABY) can be used to add an 8-bit number from Accumulator A to Regtster X (or add an 8-bit mumber from Accumulator B to Register Y a Please store your code in memory locations starting from $2000. b) Please store your EE data (the EE book prices) in memory locations starting from $3000 with the first byte accounting for the number of EE books, and other bytes accounting for the actual EE book prices; as shown below: Memory 003000 66 5D 57 SF uu uu uu leiw uuu 003008 uu uu uu uu uu uu uu ua uauuuau Please do the same thing Jor the CpE data in memory locations starting from 53010, c) After you finish the calculations, please store the results (average book price) in memory locations starting from $3030 Your program is: e

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions