asingment

Discuss about beta versions of mikroPascal compiler.
Post Reply
Author
Message
janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

asingment

#1 Post by janni » 26 Jul 2007 16:48

Asingment between different type variables works in a convenient, but not best way. For example

Code: Select all

var Mport:word;

FSR1L:=Mport;
results in moving Mport to FSR1L (which is OK) and moving Mport+1 to FSR1H! Compiler does not even hint that something's wrong. Is this intentional?

I've written that it's convenient - it could be, if there was no better method to obtain the same result:

Code: Select all

FSR1Ptr:=@Mport;
BTW, if the next release is still far away, couldn't we have beta 5 to be able to work on new projects in better environment? We could wait for the new processors definitions. Just a small favor, please?

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

Re: asingment

#2 Post by zristic » 27 Jul 2007 08:51

This code:

Code: Select all

program test;  // p18F1320

var Mport:word;

begin
  FSR1L:=Mport;
end.
Produces this:

Code: Select all

$0000	$EF04	F000			GOTO	_main
$0008	$	_main:
;prazan.ppas,5 :: 			begin
;prazan.ppas,6 :: 			FSR1L:=Mport;
$0008	$C015	FFE1			MOVFF	_mport, FSR1L
$000C	$	test_L_0:
;prazan.ppas,7 :: 			end.
$000C	$D7FF	    			BRA	$
Which is fine from my point of view.

As for the new version, I wonder why you are so nervous about it? You have a good version in your hands, the official release will be not much different from what you have.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

#3 Post by janni » 27 Jul 2007 12:49

Apparently it depends on code. What I've got (part of a procedure) is:

Code: Select all

;ownetGLCD.ppas,207 :: 			FSR1L:=Mport;
$0E16	$C030	FFE1			MOVFF	_mport, FSR1L
$0E1A	$C031	FFE2			MOVFF	_mport+1, FSR1L+1
Why am I so anxious about new release? Lately I had to work with strings, and it gets to you when instead of simply using

Code: Select all

  txt:=txt+chr(34);
you have to use

Code: Select all

  txtt[0]:=chr(34);
  txtt[1]:=0;
  Strcat(txt,txtt);


BTW, couldn't the chr function work on variables as well?

Another thing driving me nuts is the way the compiler treats search paths. I know that you regard most users too careless to give them the possibility to change search sequence but the compiler removing all search paths but the standard ones whenever it likes is a bit too much. I kind of hoped that you guys took a closer look at the search paths option after one of my posts (probably naive thinking :? ).


.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

#4 Post by janni » 27 Jul 2007 13:45

Another thing that stopped to work (PIC18, generates linker error '?main_Local_Text: const not found') is

Code: Select all

const sd:array[1..2] of string [2]=('ab','bc');

begin
  b:='';
  //strcat(b,sd[1]);
  for i:=1 to 2 do strcat(b,sd[i]);
end.
It works, however, if one uncomments the commented line. I have not bombarded you with things like this, because I wasn't sure it has not already been fixed.

Post Reply

Return to “mikroPascal Beta testing”