Circle the appropriate sequence below finding what

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: yrighted by the uploader and/or course instructor. Downloader id is shown and also encrypted throughout the document. Unauthorized reproduction/distribution is strictly prohibited. Solution (if any) is NOT audited, so use at your discretion. r 52 de 32 if (a > b) a = a + b + 1; else a = a – b; nl oa ID : (e) Do w Te ID : 11 Te 69 1 st ID : 32 52 (c) er ID: 1169 1 : 32 116 91 ade r ID: Dow nlo Page 7 of 11 Last Name (in case pages get detached):__________________ Downlo 11691 ader ID: Do wn lo ad er ID : 11 69 1 6. [10] Datastructures: Given the following definition: Dow nlo ade r ID: 116 Te st ID : 32 52 91 struct node_t { int struct node_t struct node_t } array[10]; data; *left; *right; Downl oader ID: 11691 Test ID: 3252 r ID: ade nlo Dow 91 116 Assuming that R8 = base address of array in memory, and R9 = i (an integer variable), and the following assembly code: Test Do wn ID : : 32 52 69 1 116 91 r ID: ade Dow nlo 69 1 ID 11 2 t ID: 325 Tes ID Test ID: 3252 st er 11 Te lo ad R9, R9 R10, R10 R10, R10 R11, R10 R8, R10 8(R10) 0(R10) : R10, R10, R11, R10, R10, R10, R10, 3252 ad e r st ID : 32 52 ADD ADD ADD ADD ADD LDW LDW ID: Do wn lo Te st ID : 32 52 Which of the following statements does this assembly sequence implement? Circle the correct one: 52 array[i].data ID : 32 52 array[2 * i].data 69 array[i].right Te st ID : Test ID: 3252 11 Te (c) 3252 Test ID: 1 st st Te ID (b) : 32 (a) Do 32 wn lo 52 ad er 11 69 1 ID : : ID array[i].left (e) (array[i].right)->data nlo ade r ID: 116 (f) 91 (array[i].left)->data -8 if the answer is incorrect -2 if the array index is not [i]. -2 if the term .left does not appear Oxdia @ http://www.oxdia.com Downloader Do wn lo ID: 11691 ad er This test is copyrighted by the uploader and/or course instructor. ID : 11 69 1 Downloader id is shown and also encrypted throughout the document. Unauthorized reproduction/distribution is strictly prohibited. Solution (if any) is NOT audited, so use at your discretion. Do w Dow nl oa de r (d) : ID st Te 52 32 T Downloader ID: 11691 Dow nlo ade r ID: Page 8 of 11 Last Name (in case pages get detached):__________________ Te st ID : Te st ID : 52 32 Do wn lo ad er ID : 32 52 11 69 1 1 69 11 : ID er ad ID : lo wn Do Do wn st lo ad er ID : 11 69 ID : 11 69 1 1 Tes t ID: ID : 32 52 Do 325 2 wn lo ad e r Test ID: 3252 Down load er ID: 11 Te 69 1 st 11691 Downloader ID: 1169 1 11691 ader ID: Downloader ID: 11691 Do w nl oa de r ID : Downlo 2 325 t ID: Tes 3252 Test ID: Downl oader ID: 11691 Oxdia @ http://www.oxdia.com Test ID: 3252 This test is copyrighted by the uploader and/or course instructor. Downloader id is shown and also encrypted throughout the document. Unauthorized reproduction/distribution is strictly prohibited. Solution (if any) is NOT audited, so use at your discretion. Downloader ID: 11691 Tes t ID: 52 : 32 ID 325 Te st 2 Last Name (in case pages get detached):__________________ Te st ID : 32 52 Te st ID : 32 52 Page 9 of 11 7. [10] Calling Convention: Assume the following C declarations: Test ID: 3252 int foo (int a, int b, int c, int d); int boo (void) Test ID: 3252 Fill in the prologue, post-call, and epilogue sections in the following assembly code. In the prologue you should determine which registers should be saved on the stack. In the post-call and the epilogue you should restore them. You should also determine the constants by which the stack pointer should be adjusted by. Save registers on the stack...
View Full Document

Ask a homework question - tutors are online