We want to implement a circular queue which can hold 8 integers (2 bytes each) in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
We want to implement a circular queue which can hold 8 integers (2 bytes each) in an 8086 processor based system. The data structure is placed in the data segment with label DQ. It includes the data buffer as well as an index in the buffer where new data should be entered and an index from where data should be picked. We also maintain a count of the number of entries in the queue. Both indices and the count are byte sized and initialized to zero at the beginning, indicating an empty queue. Data insert and retrieve functions have to be written for this queue in 8086 assembly language, assuming the small model. Your code should be clear and well commented. Vague and poorly commented code will incur marks penalty. a) Write the insert function for this queue, which receives an integer as input in AX and copies it to the insert index position in the buffer. Then it increments the insert index, as well as data count. If the insert index is at 7, it should be incremented to 0. All gen- eral purpose registers must be preserved. b) Write the retrieve function for this queue which receives the ad- dress of a byte flag in BX. If there are non-zero entries in the queue, the flag byte is cleared. Otherwise, the flag is set to -1 and the function returns. If the buffer is not empty, the function copies an integer from the buffer at the retrieve index to the AX register and then decrements the retrieve index as well as the data count. (If the retrieve index is 0, it should be decremented to 7). All general purpose registers except AX should be preserved. (Note: in a real queue, the retrieve function should also increment its index but the question asked you to decrement it. Full credit will be given if your code in fact increments this index as it should be done in a real queue or decrements it as asked in the question.) The function is: We want to implement a circular queue which can hold 8 integers (2 bytes each) in an 8086 processor based system. The data structure is placed in the data segment with label DQ. It includes the data buffer as well as an index in the buffer where new data should be entered and an index from where data should be picked. We also maintain a count of the number of entries in the queue. Both indices and the count are byte sized and initialized to zero at the beginning, indicating an empty queue. Data insert and retrieve functions have to be written for this queue in 8086 assembly language, assuming the small model. Your code should be clear and well commented. Vague and poorly commented code will incur marks penalty. a) Write the insert function for this queue, which receives an integer as input in AX and copies it to the insert index position in the buffer. Then it increments the insert index, as well as data count. If the insert index is at 7, it should be incremented to 0. All gen- eral purpose registers must be preserved. b) Write the retrieve function for this queue which receives the ad- dress of a byte flag in BX. If there are non-zero entries in the queue, the flag byte is cleared. Otherwise, the flag is set to -1 and the function returns. If the buffer is not empty, the function copies an integer from the buffer at the retrieve index to the AX register and then decrements the retrieve index as well as the data count. (If the retrieve index is 0, it should be decremented to 7). All general purpose registers except AX should be preserved. (Note: in a real queue, the retrieve function should also increment its index but the question asked you to decrement it. Full credit will be given if your code in fact increments this index as it should be done in a real queue or decrements it as asked in the question.) The function is:
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these electrical engineering questions
-
Suppose we want to implement a drawing program that creates various shapes using keyboard characters. Implement an abstract base class DrawableShape that knows the center (two integer values) and the...
-
We want to implement the linear convolution of a 10,000-point sequence with an FIR impulse response that is 100 points long. The convolution is to be implemented by using DFT s and inverse DFT s of...
-
Suppose that you want to implement a bag class to hold non-negative integers, and you know that the biggest number in the bag will never be more than a few thousand. One approach for implementing...
-
explain the term " system development" and describe the steps involved in system development
-
A 30-MHz uniform plane wave with H = 10 sin ( w t + x) a z mA/m exists in region x > 0 having = 0, = 9 o , = 4 o . At x = 0, the wave encounters free space. Determine (a) The polarization of the...
-
The auditor of Beastie Company is reviewing the following client information for the prior year ended December 31, 2015, and all four quarters of 2016. Characterize the accruals as discretionary or...
-
Is a drop in return on capital employed (ROCE) synonymous with a value destruction? Why?
-
The manager of a chain of electronics stores is considering running a sale on a Lexmark printer model that contains many popular features. The store buys these printers for $60 apiece and, at the...
-
Caleb Martin 9.6 Cody Zeller 6.5 Dewayne Dedmon 5.7 Dru Smith 2.2 Duncan Robinson 6.4 Gabe Vincent 9.4 Haywood Highsmith 4.4 Jamal Cain 5.4 Jamaree Bouyea 3.8 Jimmy Butler 22.9 Kevin Love 7.7 Kyle...
-
Calculate the enthalpy and entropy of saturated isobutane vapor at 360 K from the following information: 1. Table 6.1 gives compressibility-factor data (values of Z) for isobutane vapor. 2. The vapor...
-
"Aleeza Co. is a U.S company that has a subsidiary in India. It is issued bonds in the United States that are dominated in Indian rupees. The funds from the bonds' sale will be used by its subsidiary...
-
What is the output of the following App shown in Message Box? * import javax.swing.JOptionPane; public class App { public static void main(String[] args) { } int i=1; String outputStr= while (i <10){...
-
What type of marketing strategies including social media are used to attract tourist? yukon
-
In the business discipline, what personal identifying information is collected currently? How is it protected logistically and in terms of legal and compliance mandates? What are the ethical...
-
ABC Corp. allocates the Human Resources and Payroll department costs to the sales departments of Luggage and Purses. Human Resources and Payroll also provide services to each other. Human resources...
-
Image Solutions operates a printing service for customers with digital cameras. The current service, which requires employees to download photos from customer cameras, has monthly operating costs of...
-
How would DAX formula in excel look like if we need to calculate the amount of commission earned by a sales agent for revenue generated above a minimum level? DAX formula should be used in formating...
-
Chloroplasts are illuminated until the levels of the Calvin cycle intermediates reach a steady state. The light is then turned off. How does the level of RuBP vary after this point?
-
Repeat the calorie-counting program described in Programming Project 8 from Chapter 2. This time ask the user to input the string M if the user is a man and W if the user is a woman. Use only the...
-
Consider a Java class that you could use to get an acceptable integer value from the user. An object of this class will have the attributes Minimum accepted value Maximum accepted value Prompt string...
-
Consider a class Time that represents a time of day. It has attributes for the hour and minute. The hour value ranges from 0 to 23, where the range 0 to 11 represents a time before noon. The minute...
-
Given your answers to Questions 8 and 9, how do you explain the existence of convertible bonds?
-
Show that if managers think their companys shares are overvalued, there is a better product to issue than a convertible bond.
-
Show that if managers think their companys shares are undervalued, there is a better product to issue than a convertible bond.
Study smarter with the SolutionInn App