{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Exercises-Arrays&amp;Structures

# Exercises-Arrays&amp;Structures - SYSC-3006 Computer...

This preview shows pages 1–2. Sign up to view the full content.

SYSC-3006 Computer Organisation Study Exercises : Arrays and Structures 1. For each of the following C-like declarations of structures, show the corresponding assembly declaration. Provide EQU directives for addressing the elements within the structures (to be used in a later exercise) a. struct { int a; int b }; b. struct { byte a, int b; boolean c } c. struct { char a[10]; int b[4]; byte c } 2. For each of the following C-like declarations of arrays, show the corresponding assembly declaration. a. byte array[10]; b. int array[3] = {0,0,0} c. long int array[20]; d. char array[10][20]; e. int array[3][4]; f. Using the following structure definition TYPEDEF struct { int a; byte b; } STRUCT_TYPE; STRUCT_TYPE array[3]; g. Using the following structure definition TYPEDEF struct { int a; word b; char c[20]; } STRUCT_TYPE; STRUCT_TYPE array[5]; 3. For each of the following assembly structures, show how to access the identified element. a. struct { int a; int b } data; data.a = 5; data.b = 10; b. struct { byte a, int b; boolean c } data; data.a = 5; data.b = 10; data.c = FALSE; c.

This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

### Page1 / 2

Exercises-Arrays&amp;Structures - SYSC-3006 Computer...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online