<<< Pointer Types | Index | The TYPEDEF Operator >>> |
The Protected-mode programs use NEAR pointers.
NEAR pointers are stored as double word variables. For example,
.DATA ; Begin data segment b_array BYTE 0, 1, 2, 4, 8 w_array WORD 1000h, 2000h, 3000h ptr_b_arr DWORD OFFSET b_array ptr_w_arr DWORD OFFSET w_array .CODE ; Begin code segment mov esi, ptr_b_arr inc esi inc esi mov al, [esi] ; AL <- 2 mov esi, ptr_w_arr add esi, TYPE w_array mov ax, [esi] ; AX <- 2000h
<<< Pointer Types | Index | The TYPEDEF Operator >>> |