Menu

Explain Difference Implementation Using Macro Shown Oppose Using Function Thing Define Inc Q43812206

• Explain the difference in implementation between using the macro shown below as oppose to using a function to do the same t

• Explain the difference in implementation between using the macro shown below as oppose to using a function to do the same thing. #define increase_cars() { if (car_count < PARK_SIZE) car_count++; } The function prototype would be void increase_cars(void); 23. With regard to PIC18 microcontrollers, embedded system designers need to be mindful of the fact that how they write their C code can have an impact on the eventual performance of the system. For each of the following operations discuss briefly how performance may be impacted. i. Declaring a variable and specifying its type. (How does the compiler decide the physical location of the variable). ii. Using functions and whether it’s normal function or an inline function. iii. Declaring an array of data and potential size limitations. iv. Declaring many strings for use on an LCD display. V. Creating a constant value by using a macro or declaring a constant 419 is 24. Discuss briefly the difference the between a global variable and a local va of scope and memory usage. 25. Below is a snippet of Assembly code generated by the XC8 compiler you used for your projects. Text in bold italics with line numbers is the original C code. In relation to this listing answer the following questions. i. Explain the significance of the first column of numbers and explain why the value increases by 2 each time, (for example, 7FEC, 7FEE etc) Explain the significance of the second column of values. One of the second column values is blanked out. Determine what it is using the snippet from the instruction set manual shown in figure 2. Explain the purpose of the ‘MOVLB Ox1’ instruction below. Explain the significance of the words ‘ACCESS’ and ‘BANKED’ in the assembly code below and use this and the code to deduce the exact location of the ‘count’ and ‘outside_count’ variables. The ‘MOVFF’ instruction is different in a notable way to the other instructions used here and in each case is followed by a ‘NOP’. Explain the reason for this. vi. 52: 7FECOE06 7FEE 6E05 53: 7FFO 7FF2 0101 7FF4 6F04 count = 6; MOVLW Ox6 MOVWF 0x05, ACCESS outside_count = 8; MOVLW 0x8 MOVLB Ox 1 MOVWF Ox4, BANKED Show transcribed image text • Explain the difference in implementation between using the macro shown below as oppose to using a function to do the same thing. #define increase_cars() { if (car_count

Expert Answer


Answer to • Explain the difference in implementation between using the macro shown below as oppose to using a function to do the…

OR