Hello guys n gals, here I have 4 case situations which I have tested using this compiler, however only Test #1 works.
The issue is related to far and near 64k data blocks.
In general I am trying to copy data from the far to near and vice versa, with no success so far.
See if you can see the what problem is, I can't
Code:
// Definitions
byte response_string[300];
byte far far_response_string[3500];
byte *near_ptr; /////
byte *near_ptr2; /////
byte far *far_ptr; /////
byte near_array[5]; /////
/*
Code:
// Test 1: copying the contents of near pointer into contents of another near pointer
near_array[0] = 0;
strncpy( near_array, "hi", 3 );
near_ptr2 = &near_array[1];
near_ptr = &response_string[0];
*near_ptr = *near_ptr2;
clear_lcd(); sprintf( _temps, "%c", response_string[0] ); puts_lcd( _temps ); delay(3000);
*/
/*
Code:
// Test 2: copying the contents of far pointer into contents of near pointer
far_response_string[0] = 0;
_fstrncpy( far_response_string, "hi", 3 );
far_ptr = &far_response_string[1];
near_ptr = &response_string[0];
*near_ptr = *far_ptr;
clear_lcd(); sprintf( _temps, "%c", response_string[0] ); puts_lcd( _temps ); delay(3000);
*/
/*
Code:
// Test 3: copying the contents of far pointer into near array
near_array[0] = 0;
_fstrncpy( far_response_string, "hi", 3 );
far_ptr = &far_response_string[1];
near_array[0] = *far_ptr;
clear_lcd(); sprintf( _temps, "%c", near_array[0] ); puts_lcd( _temps ); delay(3000);
*/
/*
Code:
// Test 4: copying the contents of an indexed far array into index near array
far_response_string[0] = 0;
_fstrncpy( far_response_string, "hi", 3 );
near_array[0] = far_response_string[0];
clear_lcd(); sprintf( _temps, "%c", near_array0] ); puts_lcd( _temps ); delay(3000);
*/