Problem: 64k block issue

This is a discussion on Problem: 64k block issue within the C Programming forums, part of the General Programming Boards category; Hello guys n gals, here I have 4 case situations which I have tested using this compiler, however only Test ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    28

    Problem: 64k block issue

    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);
    */
    Last edited by aaronc; 06-16-2004 at 04:02 AM.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Here's an idea! Get a real compiler. Stop using Turbo C 3.0 or whatever ancient thing you're working with, and get a real compiler.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 06:20 AM
  2. Words and lines count problem
    By emo in forum C Programming
    Replies: 1
    Last Post: 07-12-2005, 04:36 PM
  3. Notepad Code Problem ???
    By keats in forum C Programming
    Replies: 8
    Last Post: 06-19-2005, 08:58 AM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21