



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Microprocessor Systems; Subject: Computer Engineering; University: University of Delaware; Term: Spring 2006;
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!




1. (30pts/20min) Analyzing and fixing a piece of code (i) (8pts/5min) Write lines (11), (12), and (13) of the following subroutine code (ii) (8pts/6min) Comment the code. Only sensible comments are welcome Notes: INC_TIMES is a variable that contains a number between 0 and 9 INIT_ARRAY is the 16bit initial address of an array of constant values LINE LABEL INSTRUCTION COMMENT ;subroutine begins (1) label1: pshh (2) pshx (3) ldhx INIT_ARRAY (4) lda INC_TIMES (5) label2: cmp # (6) beq done_deal (7) incx (8) deca (9) bra label (10) done_deal: lda ,X (11) (12) (13) ;subroutine ends (iii) (5pts/3min) In your own words, different from commenting the lines of code, tell me what it does. (iv) (6pts/5min) Suppose the memory contents shown below. If at the beginning of the subroutine INIT_ARRAY = $182D and INC_TIMES = 3 , what is the value stored in register A at the end of the subroutine? What if INC_TIMES = 0?
(v) (3pts/1min) What type of addressing mode is being used in line (10)?
2. (20pts/20min) Checking concepts. (i) (4pts/4min) Give assembly examples of four addressing modes. 1 2 3 4 (ii) (4pts/4min) Assume you have 10 memory positions (1 byte each) available in your memory to create a look-up table of numbers that are powers of two (2, 4, 8, 16, etc.). Which one is the last one? (iii) (2pts/2min) If you have an 8-bit microcontroller, how many memory locations are necessary to create a look-up table containing these numbers : 122, 238, 754, 1290? (iv) (2pts/2min) What if it were a 16-bit microcontroller? (v) (2pts/2min) Why the initialization of the stack pointer is one of the first things done in a program? (vi) (2pts/2min) What is not saved in the stack automatically by the microcontroller when executing an interrupt subroutine? (vii) (2pts/2min) What instruction must never be used to call a subroutine? Why? (viii) (2pts/2min) What instruction must never be used to end an interrupt service subroutine? Why?
4. (30pts/20min) Design. In many cars the seat belt alarm buzzer is also used to warn against leaving the key in the ignition or leaving the lights on. This is how such a system may operate: The alarm is to sound if the key is in the ignition when the door is open and the motor is not running, or if the lights are on when the key is not in the ignition, or if the driver belt is not fastened when the motor is running, or if the passenger seat is occupied and the passenger belt is not fastened when the motor is running. (i) (5pts/3min) Assuming there are sensors that produce digital signals out of the sensed variables of the car, describe the resources needed from your microcontroller (e.g. I need 1 port configured as input for this, 1 port configured as output for that, etc.) (ii) (5pts/3min) Sketch a block diagram of the system, clearly labeling the parts and indicating the direction of signals flow
(iii) (10pts/7min) Sketch a flow diagram of your software solution