Pointers question (v2.20)

General discussion on mikroPascal PRO for 8051.
Post Reply
Author
Message
matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Pointers question (v2.20)

#1 Post by matrix » 14 Sep 2010 18:32

Is there a way to access xdata memory via pointer?

User avatar
slavisa.zlatanovic
mikroElektronika team
Posts: 1321
Joined: 07 Apr 2009 09:39

Re: Pointers question (v2.20)

#2 Post by slavisa.zlatanovic » 17 Sep 2010 10:11

Hi!
Is there a way to access xdata memory via pointer?
Yes, there is. See the example below:

Code: Select all

program Test;

type
  xdata_byte = byte; xdata;
  
var x : xdata_byte;
var p123 : ^xdata_byte;

begin
 x := 0xFF;
 p123 := @x;

while TRUE do
 begin
  P0 := x;
  Delay_1sec();
  inc(p123^);
 end;
end.
Also, be sure to read about the XDATA Specifics in the Help file.
Best regards
Slavisa

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: Pointers question (v2.20)

#3 Post by matrix » 20 Sep 2010 12:35

Thank you, Slavisa, for support! It's now OK!

Post Reply

Return to “mikroPascal PRO for 8051 General”