exam2006 - CITY UNIVERSITY OF HONG KONG Course code &...

This preview shows page 1 - 3 out of 12 pages.

The preview shows page 1 - 3 out of 12 pages.
CITY UNIVERSITY OF HONG KONGCourse code & title: EE3120Microprocessor and Assembly Language ProgrammingSession: Semester A, 2006-2007Time allowed: Two hoursThis paper has 12 pages (including this cover page).Instructions to candidates:1. This paper consists of FOUR questions.2. Answer anyTHREEquestions.3. Use a separate sheet for each question.Materials, aids & instruments permitted to be used during examination: Approvedcalculator.NOT TOBETAKEN AWAY- 1 -
Question 1 (34 marks)(a)(i) State the meaning of Register-Specific Addressing and give an example of this modeof addressing that involves moving data.[5 marks](ii) Explain the usage of the instructions MOVC and MOVX and give an example for eachof these instructions.[5 marks](b)(i) Define the meanings of a stack and stack pointer? Why the stack pointer is needed?[5 marks](ii) Suppose an 8051 microcontroller is used in this question.Showthe contents of thestack and stack pointer after execution of the instructionfor each line of thefollowing program. (The PUSH and POP instructions only occupy 1 byte of thememory.)ORG 0MOV SP,#70HMOV R5,#22HMOV R2,#3FHMOV R7,#3EHPUSH 5PUSH 2PUSH 7CLR AMOV R2,AMOV R7,APOP 7POP 2POP 5[6 marks](c)(i) Write a program to check if bits 0 and 3 of register B are 1. If they are not, make themso and save them in R5. Note that the RAM location of B is F0H and is an8-bitregister.[5 marks](ii) Assume that RAM bit location 10H holds the status of phone call. If it is high, thatmeans there has been a new call since it was checked the last time. Write a program todisplay “Phone Call” on a LCD if bit RAM 10H is high. If it is low, the LCD shoulddisplay “No Phone Calls”. Suppose the subroutine for displaying the messages on theLCD is called “DISPLAY” and has been written. You can simply call this subroutinedirectly and do not need to re-write it again.[8marks]- 2 -

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 12 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
cheung
Tags
Assembly Language, Microprocessor, Serial communication, Asynchronous serial communication, Serial port

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture