Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A real - estate database is constructed in C using an array of structs that holds data on houses. A program automatically raises the taxes

A real-estate database is constructed in C using an array of structs that holds data on houses. A program automatically raises the taxes on each house by $500 each year.
struct house
i
int sqft;
int taxes;
char address [100];
I;
int main()
i
struct house homedbase [1000];
int i=0;
while )(1000!
homedbase[i].taxes +=500;
i=i+1;
a. Show how to allocate space for the empty database using assembler directives. Assume that ints are 4 bytes and chars are 1 byte. Use the .space directive with a label "homedbase:".
b. On the back of this page, convert the while loop to assembly language. Use $ t0 for variable i, and $t1$t9 for other temporaries as needed.
Tips:
Write the basic while loop first and then put the memory accesses inside of it.
Since BEQ/BNEs require registers, you'll need to put 1000 in a temporary.
You'll need to keep track of the offset from the base of the array to the current house's record
Use an additional counter register inside the loop that starts at the beginning of the homedbase and counts up by the size of the individual structs.
image text in transcribed

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

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

What are some typical issues involved in employee scheduling?

Answered: 1 week ago

Question

Design a job advertisement.

Answered: 1 week ago