few error in the hlp file..

Beta Testing discussion on mikroPascal PRO for 8051.
Post Reply
Author
Message
piort
Posts: 1379
Joined: 28 Dec 2005 16:42
Location: Laval,Québec,Canada,Earth... :-)
Contact:

few error in the hlp file..

#1 Post by piort » 28 Jul 2008 14:09

hi,
i have read the hlp file and few thing grab my eyes...

1- in 'Predefined Globals and Constants' ...
All 8051 SFR registers are implicitly declared as global variables of volatile unsigned int.
... unsigned int is C type, not pascal one... integer is the good one ))

2- in 'Accessing Individual Bits Of Variables'
If you are familiar with a particular MCU, you can also access bits by name:

// Clear TRISB3
TRISBbits.B3 := 0;
Trisb is Pic register not 8051 one ...

3- you put Uart_init in 'build-in routine AND in library ... wich one is the good one ?

4- in 'Conversions Library' ...
ltrim
Prototype: function ltrim(var txt : string[20]) : byte;

Returns: Text without leading spaces.

Description: Trims the leading spaces from an array given with txt.
If the function return string, how come the prototype return byte ? And the following exemple in the hlp file...
var txt : string[9],
b : byte;
...
txt := ' Message';
b := ltrim(txt); // b equals Message
Its impossible to fit 'Message' in one byte ))) So i suppose the return type have to be : string[txt less leading space] ...

have a nice day

octal
Posts: 534
Joined: 09 Feb 2005 14:15
Location: France
Contact:

Re: few error in the hlp file..

#2 Post by octal » 29 Jul 2008 10:54

piort wrote:hi,
i have read the hlp file and few thing grab my eyes...

1- in 'Predefined Globals and Constants' ...
All 8051 SFR registers are implicitly declared as global variables of volatile unsigned int.
... unsigned int is C type, not pascal one... integer is the good one ))

You means WORD is the good one (Integer is signed in std Pascal) ;)

Regards
octal
http://www.pocketmt.com

User avatar
marko.ziv
mikroElektronika team
Posts: 530
Joined: 06 Dec 2007 10:11
Contact:

#3 Post by marko.ziv » 29 Jul 2008 13:41

Thanks.
It will be corrected.

Regards

piort
Posts: 1379
Joined: 28 Dec 2005 16:42
Location: Laval,Québec,Canada,Earth... :-)
Contact:

#4 Post by piort » 29 Jul 2008 13:50

you means WORD is the good one (Integer is signed in std Pascal) Wink
you see now why i stick with pascal :roll:

Post Reply

Return to “mikroPascal PRO for 8051 Beta Testing”