

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
Sample questions for exam #2 in ece383, focusing on assembly language programming, arithmetic overflow, stack frames, and pic24 i/o. Topics include writing pic24 assembly language equivalents for c code fragments, detecting arithmetic overflow, implementing a branch instruction, and understanding the purpose of a stack frame. The document also covers the differences between latx and portx, weak internal pullup and open drain output capabilities, and configuring i/o pins using inline macros.
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


ECE383 Sample questions for Exam #2 The exam will be open book/notes.
The exam will focus on material from lecture 5 through lecture 8, slide 25. Knowledge from earlier lectures (1-4) may be required, but will not be the focus of the exam questions.
uint32 i, j, k; int32 x, y, z;
i=j+k; x=y-z;
int32 r, s; int16 t;
if(test<10) test++; s=(int32) t;
int16 i, j, k; int16* p_i, i=0x4000; j=0xFFFF; p_i=&i; k=*p_i;
Give the values of the following memory locations after all the instructions have executed. Complete all cells in the table.
Give the assembly language implementation of the above C code. You must use register indirect addressing to implement *p_i.
main() { int8 i, j;
i=5; j=mysub(i);
}
int8 my_sub(int8 x) { int8 y; int8 z=0;
for(y=0;y<x;y++) z++;
return z; }
a) Write an inline macro named CONFIG_SW1() that, when used, would correctly configure RB12 as a digital input as shown. b) Write an inline macro named CONFIG_LED1() that, when used, would correctly configure RB13 as a digital output as shown.