Oxdiacom this test is copyrighted by the uploader

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: the following definition in c-code, and that int's are 32bits: struct element { int x; int y; } array[10]; Downloa : ID st Te 11691 der ID: 1 er ID: 1169 load Tes Te st ID : t ID: 32 51 325 1 Down er ad lo wn Do er 11 ad : lo ID wn Do 69 : 1 ID 1 69 11 91 116 r ID: ade nlo Dow a) [5] Fill in the appropriate value for the .space directive to properly allocate space for the array of structs: Te st 32 51 Test ID: 3251 .section .data .align 2 .space __10 * 8 array: 32 51 ID : ID : 32 51 st ID : Te st Downloader ID: 11691 er ad lo wn Do 11 69 1 -5 if not correct : ID : 1 69 11 ID b) [5] Implement the following c-code in assembly, assuming that r8 holds the base address of 'array', that r9 holds 'i', and r10 should hold 'value' when your assembly code finishes executing. Downlo Do wn lo ad e r ader ID: 11691 32 51 value = array[i].y; 1 st ID : ANSWER: : ID 11 st Te Te 69 movia r8, array add r10, r9, r9 # calculate array + 8 * i add r10, r10, r10 add r10, r10, r10 add r10, r10, r8 ldw r10, 4(r10) ID : 11 69 Do wn lo ad er ID : 11 69 1 If the result is not correct MAX points is 3 load er ID: 1169 1 Oxdia @ http://www.oxdia.com Do wn lo ad er ID This test is copyrighted by the uploader and/or course instructor. : 11 69 ID r de 1 -1 if base does not appear as part of the calculation -1 if i does not appear as part of the calculation -1 if I is not multiplied by 8 -1 if base + 8 * I does not appear -1 if the offset 4 does not appear -1 if the load is not there Down nl oa er 1 Downloader id is shown and also encrypted throughout the document. 11691 Downloader ID: Unauthorized reproduction/distribution is strictly prohibited. Solution (if any) is NOT audited, so use at your discretion. Do w lo ad : 51 32 Do wn Test ID: 3251 Downloader ID: 11691 11 69 1 : wn lo ad er ID ID : st Te Do 51 32 Page 6 of 11 Last Name (in case pages get detached):__________________ Do wn lo ad er ID : 11 69 1 5. [20] Interrupts: Assume a new device called mydev, capable of both byte input Test and output, polling and interrupts. The following spec defines the device: 325 Tes 1 t ID: Do wn lo ad er ID : 11 69 er...
View Full Document

This document was uploaded on 01/28/2014.

Ask a homework question - tutors are online