MidtermSpring2008

MidtermSpring2008 - 13-4-2008 BILKENT UNIVERSITY EEE212...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
13-4-2008 BILKENT UNIVERSITY EEE212 Microprocessors Sections 1-5 Midterm Open TextBook Closed Noted , No Calculators Use the boxes provided for your answers! Use comments for readability , otherwise the programs will be partially graded! Duration: 2 ¼ hours Surname:_______________________________________ Name:_________________________________________ ID-Number:___________________________________ Signature:________________________ Q1 (20 points) Q2 (50 points) Q3 (30 points) TOTAL
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Q1) [20 pts] Write a procedure with the name FINDAB to search the RAM locations from 40h to 60h for the string “AB”. In other words, determine if the RAM locations 40h-60h contain 41h (ASCII code for “A”) and 42h (ASCII code for “B”) consecutively . If this happens (at least once), transmit the ASCII representation for “Y” to Port-1; otherwise send “N” to Port-1. For example, if the RAM locations have 02h, 53h,…,33h, 41h, 42h , 59h, respectively, then “Y” should be sent to Port-1. FINDAB : MOV R0, #40H ; initial address MOV R2, #21H ; number of bytes MOV R3, #00 ; indicator for 'A' MOV R4, #00 ; indicator for 'AB' AGAIN: MOV A, @R0 CJNE A, #'A', NEXT MOV R3, #01 S J M P N E X T 3 NEXT: CJNE R3, #01, NEXT2 CJNE A, #'B', NEXT2 MOV R4, #01 NEXT2: MOV R3, #00 NEXT3: INC R0 DJNZ R2, AGAIN MOV A, R4 ; transmission of 'Y' or 'N' J Z N O P E MOV P1, #'Y' S J M P E X I T NOPE: MOV P1, #'N' EXIT: RET
Background image of page 2
Q2) For parts a) and b) of this problem, we will write a procedure with the name MULDECIMAL
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

MidtermSpring2008 - 13-4-2008 BILKENT UNIVERSITY EEE212...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online