Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a) In order to debug an embedded application or to understand an embedded applic

ID: 3882649 • Letter: A

Question

a) In order to debug an embedded application or to understand an embedded application developed by someone else, it is often necessary to understand how data memory is modified by C code statements Fill in the given memory map after the C fragment below has been executed. Note: The TM4C123 uses Little Endian ordering for memory (i.e. lower significant bytes of an element are stored at lower addresses). char msg[4] = "Sal": short age [1] = {0x2070}: int speed [2]: msg[3] = 0 x 61: msg[1] = 0 x 6F: age = [0] = age [0] + 2: speed [0] = 0x696C6345: age [3] = 0x7370: age [4] = 0x65: printf("%s", msg): b) What message will printf print for part a)

Explanation / Answer

printf prints "Sola"

0x61 = a and 0x6F = o

msg[0] = S, msg[1] = a, msg[2] = l

msg[3] = a and msg[1] = o

thus : msg[0] = S, msg[1] = o, msg[2] = l , msg[3] = a