3.2.4 Systems with Direct Access to the Memory Containing the Data File

The memory space holding the data file is accessible by the microprocessor. It can be treated as an array of unsigned characters. In this case:

  1. Disable the USE_PAGING compiler switch.
  2. Assign the physical address pointer to the first element of the data memory location (image_buffer defined in dpcom.c). Image_buffer is used as the base memory for accessing the information in the programming data in storage memory.

The dp_get_data function calculates the address offset to the requested data and adds it to image_buffer. Return_bytes is the requested data.

dp_get_data Function Implementation

DPUCHAR* dp_get_data(DPUCHAR var_ID,DPULONG bit_index)
{
DPULONG image_requested_address; 
if (var_ID == Header_ID)current_block_address = 0;
else 
dp_get_data_block_address(var_ID);
if ((current_block_address ==0) && (var_ID != Header_ID))
{
return_bytes = 0;
return NULL;
}
/* Calculating the relative address of the data block needed within the image */
image_requested_address = current_block_address + bit_index / 8;
return_bytes=image_size - image_requested_address;
return image_buffer+image_requested_address;
}