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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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