POSTDEC1,2 error in simulator ?!

Discuss about beta versions of mikroPascal compiler.
Post Reply
Author
Message
yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

POSTDEC1,2 error in simulator ?!

#1 Post by yo2lio » 27 Mar 2008 09:36

HI,

This code work ok in simulator (move string right with one position ...):

Code: Select all

  data1 := '1234';
  FSR1Ptr := @data1 + 3;
  FSR2Ptr := @data1 + 4;
  while true do POSTDEC2 := POSTDEC1;
Just changing FSR1Ptr with FSR2Ptr and POSTDEC1 with POSTDEC2, in simulator string will be null !

Code: Select all

  data1 := '1234';
  FSR2Ptr := @data1 + 3;
  FSR1Ptr := @data1 + 4;
  while true do POSTDEC1 := POSTDEC2;
I don't know yet it's code problem (hex) or simulator problem ...
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: POSTDEC1,2 error in simulator ?!

#2 Post by zristic » 27 Mar 2008 10:59

I do not know where the problem is, it is maybe because we are using FSRxPtr inside compiler, we never intended it to be use by a user...

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#3 Post by yo2lio » 27 Mar 2008 11:45

I think, the problem it's possible to be in simulator .

Tested in MikroC and i found same problem. This code work ok :

Code: Select all

char data[] = {1,2,3,4,0} absolute 200;

void main(){
  FSR2H = 0;
  FSR2L = 204;
  FSR1H = 0;
  FSR1L = 203;
  while (1) {
    POSTDEC2 = POSTDEC1;
  }
}
This code no :

Code: Select all

char data[] = {1,2,3,4,0} absolute 200;

void main(){
  FSR1H = 0;
  FSR1L = 204;
  FSR2H = 0;
  FSR2L = 203;
  while (1) {
    POSTDEC1 = POSTDEC2;
  }
}
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

Post Reply

Return to “mikroPascal Beta testing”