Write a program to solve a problem of stack

Assignment Help Basic Computer Science
Reference no: EM131209856

[M] Write an IA-32 program to solve Problem 2.22 in Chapter 2. Assume that the element to be pushed/popped is located in register EAX, and that register EBX serves as the stack pointer for the user stack.

Problem 2.22

[M] In addition to the processor stack, it may be convenient to use another stack in some programs. The second stack is usually allocated a fixed amount of space in the memory. In this case, it is important to avoid pushing an item onto the stack when the stack has reached its maximum size. Also, it is important to avoid attempting to pop an item off an empty stack, which could result from a programming error. Write two short RISC-style routines, called SAFEPUSH and SAFEPOP, for pushing onto and popping off this stack structure, while guarding against these two possible errors. Assume that the element to be pushed/popped is located in register R2, and that register R5 serves as the stack pointer for this user stack. The stack is full if its topmost element is stored in location TOP, and it is empty if the last element popped was stored in location BOTTOM. The routines should branch to FULLERROR and EMPTYERROR, respectively, if errors occur. All elements are of word size, and the stack grows toward lower-numbered address locations.

Reference no: EM131209856

Questions Cloud

Does frere bros have any remedy : During the first year of the agreement, Joe entered into a contract to star in a film being made by Pretty Pictures. Does Frère Bros have any remedy?
Propose a procedure for manipulating the two pointers : As data items are added to the queue, they are added at successively higher addresses until the end of the memory region is reached. What happens next, when a new item is to be added to the queue?
Eating half of the steak : Suppose you are on a date at Mastro's Steakhouse and order the 16oz New York Strip. After eating half of the steak, you feel full. Your date tells you that you should finish the steak since you have to pay for it regardless and should eat it while..
Describe the law and how you would address the issue : Using a minimum of three scholarly sources, compare and contrast the pros and cons of required professional qualifications for all medical examiners, regardless of where they work. Should a person who conducts an autopsy be required to be medicall..
Write a program to solve a problem of stack : [M] Write an IA-32 program to solve Problem 2.22 in Chapter 2. Assume that the element to be pushed/popped is located in register EAX, and that register EBX serves as the stack pointer for the user stack.
What is risk all business organisations strive : What is risk All business organisations strive to achieve specific goals, within the process businesses all take risks to determine outcomes - Legal and regulatory risk In the production of hospitality businesses we experience legal and regulatory..
Identify three to four companies for whom you want to work : Identify three to four companies for whom you want to work (your target market and how you can fulfill its needs/wants), and how you think your skill set will benefit them.
Sound environmental policy necessarily conflict : Do economic growth and sound environmental policy necessarily conflict?
Determine the capacitance of each capacitor : A 3-phase, 50 Hz, 400 V motor develops 100 H.P. (74·6 kW), the power factor being 0·75 lagging and efficiency 93%.- Determine the capacitance of each capacitor.

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  What is the new profit maximizing number of students

What is the relevance of the marginal rule (MR = MC) in your decision making?

  The visio diagram reflects the database design

1.  Write a one to two (1-2) page paper in which you: a.  Discuss the degree to which you believe the Visio diagram reflects the database design.   b.  Describe any assumptions that you had to make about the business rules to in order to create the V..

  Cpu training

What kinds of tools would be considered media for computer-based training?

  Provide an explanation of hash tables

Provide an explanation of hash tables, including a description of a realistic scenario that could be solved with the application of a hash table.

  Comment on the performance and scalability of this scheme

Comment on the performance and scalability of this scheme.

  Compare and contrast the mmorpg interaction environment

Describe cognitive social phenomena that occur specifically to the context of the MMORPG that wouldn't happen in a face-to-face chess game. Compare and contrast the MMORPG interaction environment and a face-to-face environment where chess is being..

  Hardware-software setup required

According to the Siles (2010), the huge adoption of wireless technologies over recent years has placed wireless data (or Wi-Fi) networks, based on the 802.11 specifications, as one of the major attack vectors for organizations nowadays.

  A huge number of dissidents can camp

A huge number of dissidents can camp for quite a long time in a city like New York, yet a hundred or so nonconformist's camp in Melbourne's City Square and ruler leader Robert Doyle brings in the uproar squad and security inside of a week. They might..

  How might denormalization improve performance

Developers denormalize the design,for performance reasons. How might denormalization improve performance? Remember to provide a small sample at least five tables with sample information.

  How would you communicate the design of method to developer

How would you communicate the design of method to a developer that must implement a complex algorithm and ensure that they implement correctly when provided good inputs as well as handle bad input and no input scenarios?

  What is the function of the new html5 element

What function does the browser's rendering engine perform?

  Dilemma or ethically questionable situation relating

Identify a recent (within the last six (6) months) ethical dilemma or ethically questionable situation relating to ICT that you are familiar with. This situation can be either in the media (for example one you have sourced from a newspaper, or onl..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd