A problem with XDATA variable ...

General discussion on mikroPascal PRO for 8051.
Post Reply
Author
Message
Waldo
Posts: 9
Joined: 08 Dec 2016 09:29

A problem with XDATA variable ...

#1 Post by Waldo » 08 Dec 2016 10:15

Hello community, I have a problem with XDATA variable ...
I hope you can help me.
An example:

Test;

Var s1: string [5]; Xdata;
S2: string [5];
L1, l2: word;

Begin
S1: = '1234';
S2: = 1234 ';
L1: = strlen (s1); // res = 0
L2: = strlen (s2); // res = 4
end.

// 8951mlk File:
<XDATA> Min 0x0000, Max 0x3fff

Why are the results not the same?

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: A problem with XDATA variable ...

#2 Post by lana.arsic » 09 Dec 2016 14:33

Hi,

I have answered you here:

http://forum.mikroe.com/viewtopic.php?f ... 11#p277630

Best regards,
Lana

Waldo
Posts: 9
Joined: 08 Dec 2016 09:29

Re: A problem with XDATA variable ...

#3 Post by Waldo » 15 Dec 2016 18:25

First of all thank you for the reply.
Now I no longer wonder why the strangest effect have occurred.
This means I have to write my own routines with each access to xdata variable, and can not access the implemented routines in the program.
This is also quite confusing and complicated when I have to work with xdata variable always with pointern, because I have a lot of variables in the xdata.
Too bad that does not work ...
I'll probably need to continue using turbo51....

Post Reply

Return to “mikroPascal PRO for 8051 General”