Docsity

Practice Exam 3 - Microprocessor Systems I | EE 3376, Exams of Microprocessors

Toggle sidebar
bg1
EE3376 โ€“ Embedded Systems - Fall 2007 - Exam 3 โ€“ MacDonald โ€“ Page 1
Student Name:______________________________ Student ID: _______________
Problem 1
Write the equivalent C code for the assembly below using only one control structure.
Assume first, second and third are local variables and that the X register is a stack
frame pointer. Parentheses are the hard part here.
ldaa first,X
cmpa #$00
bne inner
ldaa second,X
cmpa #$10
blt done
ldaa third, X
cmpa #$FF
beq done
inner: jsr do_something
done: jsr do_something_else
pf3

Partial preview of the text

Download Practice Exam 3 - Microprocessor Systems I | EE 3376 and more Exams Microprocessors in PDF only on Docsity!

Student Name:______________________________ Student ID: _______________

Problem 1 Write the equivalent C code for the assembly below using only one control structure. Assume first , second and third are local variables and that the X register is a stack frame pointer. Parentheses are the hard part here.

ldaa first,X cmpa #$ bne inner ldaa second,X cmpa #$ blt done ldaa third, X cmpa #$FF beq done inner: jsr do_something done: jsr do_something_else

Student Name:______________________________ Student ID: _______________

Problem 2

Write a configuration subroutine that will configure and enable the A2D to take continuous 8 bit samples on channels 2 and 3. No timing requirements included.