March 2010
Beginner
760 pages
18h 51m
English
During execution, your program may refer to record objects indirectly using a pointer. When you use a pointer to access fields of a structure, you must load one of the 80x86's 32-bit registers with the address of the desired record. Suppose you have the following variable declarations (assuming the Object8 structure from an earlier section):
static
Cube: Object8;
CubePtr: pointer to Object8 := &Cube;CubePtr contains the address of (that is, it is a pointer to) the Cube object. To access the Color field of the Cube object, you could use an instruction like mov( Cube.Color, eax );. When accessing a field via a pointer, you first need to load the address of the object into a 32-bit register such as EBX. The instruction mov( ...