Searching \ for 'Byte Craft (MPLABC) to HITECH C compiler' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=mplab
Search entire site for: 'Byte Craft (MPLABC) to HITECH C compiler'.

Truncated match.
PICList Thread
'Byte Craft (MPLABC) to HITECH C compiler'
1998\04\14@191413 by John Bellini

flavicon
face
How do you redefine the following from Byte Craft C compiler to HITECH?
The HITECH C compiler keeps giving me a "constant expression required"
error.

char val[10] @ string[32];      // note this resides within string[]
char val2[7] @ string[42];      // saved string for 2 variable displays


It also does not like this sort of definition.
bits special;                   // special handling, bank max.
bits system_flags1;             // system flags
bits system_flags2;             // system flags

I looked at the help section but there is not much about what you can
and cannot do in regards to C syntax.

Thank you,
John Bellini
spam_OUTjbelliniTakeThisOuTspamstatpower.com">http://.....jbelliniKILLspamspam@spam@statpower.com

1998\04\14@200204 by John W. Temples

flavicon
face
On Tue, 14 Apr 1998, John Bellini wrote:

> How do you redefine the following from Byte Craft C compiler to HITECH?
> The HITECH C compiler keeps giving me a "constant expression required"
> error.
>
> char val[10] @ string[32];      // note this resides within string[]
> char val2[7] @ string[42];      // saved string for 2 variable displays

I would imagine you could do this using proper C with the Hi-Tech
compiler by using a union.  The Hi-Tech compiler uses "@" to locate
variables at specific hardware addresses; that's why you're getting the
"constant expected" error -- it's looking for a physical memory address.

> It also does not like this sort of definition.
> bits special;                   // special handling, bank max.
> bits system_flags1;             // system flags
> bits system_flags2;             // system flags

Look at Hi-Tech's "bit" type.

> I looked at the help section but there is not much about what you can
> and cannot do in regards to C syntax.

All of the above is documented in the manual that's on the CD in the
"Features and Runtime Environment" section.

--
John W. Temples, III       ||       Providing the first public access Internet
Gulfnet Kuwait             ||            site in the Arabian Gulf region

1998\04\14@202007 by John Bellini

flavicon
face
I am using the demo version of this so I don't have an elaborate help
section that I know of at this time.

> {Original Message removed}

1998\04\14@205320 by Richard Nowak

picon face
MPLAB-C works the same way.  For example if you want to store a long and
work with the high and low bytes individually you would do this (because
MPLAB-C has math trouble with longs):

unsigned long a;
unsigned char al @ a;        // low byte
unsigned char ah @ a+1;   // high byte

These RAM locations are *NOT* reserved.

To reserve memory find the line in the PICName.h file (or similar):
#pragma memory RAM [MAXB0  - 0x26]  @ 0x26;     // first 0x25 locations reserved

and change it to:
#pragma memory RAM [MAXB0  - 0x28]  @ 0x28;      // reserve two additional bytes

Then

unsigned long a @ 0x26;
unsigned char al @ a;        // low byte
unsigned char ah @ a+1;   // high byte

a, al, ah will not be used by the compiler to assign any other variables.

rich


At 05:00 PM 4/14/98 -0700, you wrote:
{Quote hidden}

Internet
>Gulfnet Kuwait             ||            site in the Arabian Gulf region
>

1998\04\15@003208 by Clyde Smith-Stubbs
flavicon
face
On Tue, Apr 14, 1998 at 05:10:14PM -0700, John Bellini wrote:
> I am using the demo version of this so I don't have an elaborate help
> section that I know of at this time.

The full manual is available on our Web site. What I'd suggest though is that
instead of just asking "how do I translate this XX compiler feature to HI-TECH",
that if you describe the problem you are trying to solve, there may be a better
way to do it.

--
Clyde Smith-Stubbs               |            HI-TECH Software
Email: clydespamKILLspamhtsoft.com          |          Phone            Fax
WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
PGP:   finger .....clydeKILLspamspam.....htsoft.com   | AUS: +61 7 3354 2411 +61 7 3354 2422
---------------------------------------------------------------------------
HI-TECH C: compiling the real world.

1998\04\15@043346 by Scott Walsh

flavicon
face
    John,

    It looks like you are parsing a string or something that may have
    arrived via a serial port or similar ... could I suggest you use a
    pointer to a BYTE .... see below!

    Use this pointer to then 'point' into your serial port buffer (FIFO)

    A little note, try these as they are common things.

    typedef unsigned short  WORD;
    typedef unsigned char   BYTE;
    typedef unsigned long   DWORD;
    typedef unsigned char * STRING;

    regards,
    SW.


______________________________ Reply Separator _________________________________
Subject: Byte Craft (MPLABC)  to HITECH C compiler
Author:  pic microcontroller discussion list <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU> at
INTERNET
Date:    14/04/98 16:11


How do you redefine the following from Byte Craft C compiler to HITECH?
The HITECH C compiler keeps giving me a "constant expression required"
error.

char val[10] @ string[32];      // note this resides within string[]
char val2[7] @ string[42];      // saved string for 2 variable displays


It also does not like this sort of definition.
bits special;                   // special handling, bank max.
bits system_flags1;             // system flags
bits system_flags2;             // system flags

I looked at the help section but there is not much about what you can
and cannot do in regards to C syntax.

Thank you,
John Bellini
jbellinispamspam_OUTstatpower.com">http://@spam@jbelliniKILLspamspamstatpower.com

1998\04\16@145231 by Patricia Pugliese

picon face
The Byte Craft compiler is the MPC Code Development System not the MPLABC.


Patricia Pugliese
Byte Craft Limited
----------
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...