Hi Alan,

Thank you for your answer ,

char *ptr;
ptr = MemPtrNew(10000) ;

doesn't help,

The launch code is 'sysAppLaunchCmdNormalLaunch'
Here are the variable values passed to my PilotMain() when I start the
program :

cmd = 0
cmdPBP = 0x00000000
launchFlags  = 142

On the other hand I am using CodeWarrior under Windows XP but when I go to
target setting I can only choose 'Macintosh 68k' or 'MacOs merge'.Also the
'Rom Transfer.prc' file that I have uploaded to my Emulator, I am not sure
whether it's appropriate for the Palm III platform that I am using for my
Emulator.

Do these settings and variables affect my program, thank you very much for
your continues help.

Peyman.


> -----Original Message-----

>Umm.. Why not replace
>
>static char far ptr[10000];
>
>with
>
>static char* ptr;
>
>then allocate the memory spperately:
>
>ptr = MemPtrNew(10000);
>
>If that doesn't help things, secondly, what type of launch code are you
>giving the program when starting debug mode? (a no-globals launch?)
>
>Alan


>> -----Original Message-----

>>Hi every body,

I have written a simple code that doesnt work, I am running this program in
debug mode while Emulator is running, when I build with F7 I get the
following warning  :

"global variable ptr is accessed using A5 register ..."

--------------------------------------------  Here is the program code :

...
....

static char far ptr[10000];


static UInt32 ap_w1PalmMain(
    UInt16 cmd,
    MemPtr /*cmdPBP*/,
    UInt16 launchFlags)
{
    Err error;
    int i, j, x = 0;


    error = RomVersionCompatible (ourMinVersion, launchFlags);
    if (error) return (error);

    for(i = 0; i < 100; i++)
    for(j = 0;j < 100; j++)
    ptr[i*100 + j] = j;


// Rest of program
............
...........

-----------------------------------------------------------------





When I run this program, the Emulator gives me the following error message :

ap_w1 (1.0) just wrote to memory location 0x0000000F8 which is in low
memory.
"Low memory" is defined as the firt 256 bytes of memory ....


I used MemHanleNew(), MemHandleLock(), MemPtrNew(), ... with different
appropriate variable types but I still get the same error message.

Is this because I'm using the Demo version of MetroWercks Codewarrior or I'm
making another mistake


Thank very much for your help.

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to