Write compact code to avoid running out of memory

Assignment Help Computer Engineering
Reference no: EM131483508

Copy and paste this code into the simulator's source code editor and save as "Lift".

; ----- EXAMPLE - CONTROLLING THE LIFT --------------------------
Start:
CLO
MOV AL, 00
OUT 06 ; Display lift window

Loop:
IN 06 ; Read lift status
AND AL, 20 ; Isolate UP button bit
JZ Loop ; Loop if UP button not pressed
IN 06 ; Read lift status
AND AL, DF ; Clear UP button bit
OR AL, 01 ; Set UP motor bit
OUT 06 ; Reset UP button and turn on UP motor
JMP Loop

END
; --------------------------------------------------------------

Run the program. Wait for the lift window to appear then click the UP button in the lift window. The lift UP motor is then turned on and the lift will rise until it crashes into the top of the shaft, even if you stop your program. Click the "Repair Crashed Lift" button to restore the lift window.

Note the use of AND to clear a single bit without affecting other bits and OR to set a bit without affecting other bits.

Read the full capabilities of the lift in the Tutorial section on Peripheral Devices.

Each step below adds functionality to the lift. Complete as many steps as you can, saving your program in a different file at each step (take care not to overwrite previous steps). Don't miss out steps and try write the final program in one go or you will have nothing to submit if you fail.

You will need to write compact code to avoid running out of memory. You must not store code in locations reserved for the memory mapped display, [C0] to [FF]. If you use procedures or interrupt routines, you must not store code in locations used by the call stack, [BF] downwards, or your code will be overwritten at run time.

You may use any of the techniques you learned in the tutorials.

Discuss ideas and techniques with colleagues but do not copy code from each other or from the Internet. We will check for plagiarism.

Submit the last WORKING version of your program to NESS.

Marks will be awarded for each step successfully completed and for correct functionality. Programs which do not assemble will receive a zero mark. Programs which do not function will receive a zero mark.

Coursework

Modify your program to:

1. Detect when the lift nears the top of the shaft then turn off the motor before it crashes.

(If you have to make your simulation run Faster to avoid crashing before the limit can be detected, you should consider restructuring your code)

2. Detect a click of the DOWN button then turn on the DOWN motor.

(You may allow the lift to crash into the bottom of the shaft)

3. Detect when the lift nears the bottom of the shaft then turn off the motor before it crashes.

(It should now be impossible to crash the lift no matter when or how many times the UP or DOWN buttons are clicked)

4. Display the lift status on the memory mapped display starting at [C0] without crashing the lift.

(Lift status must be exactly: BOTTOM or UP or TOP or DOWN)

5. Cause the lift to return to the bottom of the shaft immediately if the Enter key (En) is pressed on the numeric keypad peripheral device.

(After returning to the bottom of the shaft, the lift must operate normally)

Reference no: EM131483508

Questions Cloud

Prepare a report for the couple answering the issues : FIN2IFP Introduction to Financial Planning - what price range is the couple reasonably able to afford and accordingly how much will they be required to borrow from a bank?
What average number of customers can be expected in line : What average number of customers can be expected in line? How many customers can be expected in the department/system?
Accounting system accumulates costs of manufacturing : The Fashionable Company manufactures various types of clothing. The computerized cost accounting system accumulates the costs of manufacturing these products.
Roosevelts motivation for the new deal stemmed : Do you believe that Roosevelt's motivation for the New Deal stemmed.
Write compact code to avoid running out of memory : You will need to write compact code to avoid running out of memory. You must not store code in locations reserved for the memory mapped display
Reflect agreement between collector and ageless antiques : Write the agency contract to reflect this agreement between Collector and Ageless Antiques.
Describe the trade liberalization : Brandeis University professor Stephen Cecchetti has argued that "if people understood the benefits of free trade as well as they do the rules of a favorite.
Fairness and accuracy of our appraisal instruments : Recently, many companies have decided to reduce their leniency problem (ratings are too high) by implementing new instruments such as forced distribution system
State and local finance : Each May school districts across the state vote on their budget for the upcoming school year. Go to your home town's school district web site.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Can you give the corresponding e-r diagram

For each following statement, please give the corresponding E-R diagram (entities and relationship), and the structural constraints (Cardinality and Participation)

  Obtain the boolean expressions

Obtain the Boolean expressions for the following circuit

  By using a personal computer as a base model write a c

using a personal computer as a base model write a c syntactically correct class definition demonstrating composition.

  Use java to write the programs1 write a program that uses

use java to write the programs1. write a program that uses the brute-force approach to solve the 01 knapsack problem.

  Write down some of the companies which make embedded

what are some of the companies that make embedded operating systems and are these operating systems just scaled down

  Examine the importance and purpose of of n-tier systems

Examine the importance and purpose of of n-tier systems

  Complete the timing diagram for the input sequence

Analyze the fundamental-mode circuit shown in Figure 8.37 to determine the excitation and output tables. Complete the timing diagram for the input sequence.

  Prepare a gantt chart or project plan template

Create a Gantt chart or project plan (summary and detailed) template. The Gantt chart or project plan should Record all tasks, subtasks, resources, and time related to the project.

  Find the difference between a blog and a wiki

Explains what blogs are and how they could be used in a business environment. Give two examples of how a business might use blogs. What is the difference between a blog and a wiki.

  How to open microsoft word and paste the information

In this assignment, you will find out and critique virtual information and word processing skills to make a professional-looking document that promotes personal development or financial growth and maturity.

  How many different normal forms to choose from

how many different normal forms to choose from.

  Design an implementation approach for the database design

design an implementation approach for the database design process to the kelsey elementary school. include

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