Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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)

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92292244

Have any Question?


Related Questions in Computer Engineering

What is the lithium by mass in a sample of pure lithium

What is the % lithium by mass in a sample of pure lithium carbonate that has a sample size of 10.0g?

By chance does any know what percentage of the world gdp

By chance does any know What percentage of the world GDP has the Global 500 contributed most recently?

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Which of the following instructions must be privileged, executable only in system mode? ...

There is a formula that calculates what a lifetime and

There is a formula that calculates what a lifetime and loyal customer contributes to long term profit and it is an astounding amount. Question - How would a company achieve such a feat?

Can someone help me identify how intrustion detection

Can someone help me identify how Intrustion detection system and intrusion prevent system can help protect confidentiality, integrity and availability.

Question what is the syntax of the while construct in the c

Question : What is the syntax of the "while" construct in the c programming language? Show how the while construct can give the functionality of the "for" construct, for (init-phrase; test-cond; incr-phrase)

Question suppose that 80 community delegates discussed the

Question : Suppose that 80 community delegates discussed the transportation problems on Oahu. 30 of them favor expanding the bus system, 34 favor introduction of rail, and 44 favor building more highways. 15 favor a comb ...

Whats the relationship between organizational performance

What's the relationship between organizational performance and financial management practices. These include capital structure decision, investment appraisal techniques, dividend policy, working capital management and fi ...

A company that supplies batteries for watches guarantees

A company that supplies batteries for watches guarantees that 95% of the batteries it ships will be free from defects. You test a sample of 50 batteries you received. You find that fewer than 10 have defects. Does this l ...

Q1 state whether the following is true or false and why1

Q1. State whether the following is true or false and why: (1) Monopolists can charge whatever price they want and maximize profit since they are price makers.  T/F: Why? (2) A firm that has a monopoly on a certain good m ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As