Structures Flashcards
(5 cards)
1
Q
- Collection of data with different types
- Contiguous bytes of memory divided according to data type used by user
A
Structures
2
Q
In structures, we need to know the following:
A
- the size of each field
- the size of the whole structure
- the starting address of each field
3
Q
True or False
To access a specific field, just identify the address of that field by specifying its offset from the base address.
A
True
4
Q
Convert this to assembly:
struct student { char name[10]; int age; int score; }; struct student x;
A
Define structure size:
student equ 13
Define starting byte of each field:
name equ 0 nameLen equ 10 age equ 11 score equ 12
5
Q
Accessing Members/Fields
A
- specify array cell to use (i*size)
- specify field to use