EmbeddedRelated.com
Forums

68hc12 C compiler and assembly instruction set

Started by Naheed M K August 7, 2003
Hi
Does anyone know where can I get any free C Compiler for 68hc12.
Also I would like to get a url for understanding complete instruction
set in detail for 68hc12.

Thanks
Naheed



Yup, I found it 12k size of code can be compiled by free standard
edition of codewarrior, Yaaahoooo. Thanks to google search.

http://www.metrowerks.com/MW/download/updates.asp?
date_op=on+or+after&year&month&day=1&did=find&vers=CWHC12&submit
=Select+Update+%3E%3E

Thanks
Naheed

--- In , "Naheed M K" <naheedmk@y...> wrote:
> Hi
> Does anyone know where can I get any free C Compiler for 68hc12.
> Also I would like to get a url for understanding complete
instruction
> set in detail for 68hc12.
>
> Thanks
> Naheed




Yup, I found it 12k size of code can be compiled by free standard
edition of codewarrior, Yaaahoooo. Thanks to google search.

http://www.metrowerks.com/MW/download/updates.asp?
date_op=on+or+after&year&month&day=1&did=find&vers=CWHC12&submit
=Select+Update+%3E%3E

Thanks
Naheed

--- In , "Naheed M K" <naheedmk@y...> wrote:
> Hi
> Does anyone know where can I get any free C Compiler for 68hc12.
> Also I would like to get a url for understanding complete
instruction
> set in detail for 68hc12.
>
> Thanks
> Naheed





Your Yaaahoooo maybe short lived, once you start to decipher the
codewarrior help and documentation. Metrowerks will provide you no
help for this version.

Walt

--- In , "Naheed M K" <naheedmk@y...> wrote:
> Yup, I found it 12k size of code can be compiled by free standard
> edition of codewarrior, Yaaahoooo. Thanks to google search.
>
> http://www.metrowerks.com/MW/download/updates.asp?
> date_op=on+or+after&year&month&day=1&did=find&vers=CWHC12&submit
> =Select+Update+%3E%3E
>
> Thanks
> Naheed
>


Am Thu, 07 Aug 2003 16:10:17 -0000 hat Naheed M K <>
geschrieben:

> Hi
> Does anyone know where can I get any free C Compiler for 68hc12. Also I
> would like to get a url for understanding complete instruction set in
> detail for 68hc12.
>
> Thanks
> Naheed

Try the GNU-tools at http://m68hc11.serveftp.org. It compiles also for
HC(S)12

For instruction set details you may look at the motorola website for the
HC(S)12-core manual. Sorry have no link.

Bye

Daniel Postler



The rest of the GNU stuff is:
http://savannah.gnu.org/projects/m68hc11
http://www.gnu.org/software/m68hc11/
(It says 68hc11, but it's also 68gc12 and mc9s12/68hcs12)
Installs easily in MS windows or linux.
There is a busy Yahoo newsgroup for support.

The code quality is as good as any commercial compiler, IMO.

Unlike free commercial "limited releases", there are no limits on
program size. --- In , "Naheed M K" <naheedmk@y...> wrote:
> Hi
> Does anyone know where can I get any free C Compiler for 68hc12.
> Also I would like to get a url for understanding complete instruction
> set in detail for 68hc12.
>
> Thanks
> Naheed





Mysterious Mister Z wrote:

[GNU C for the HC12]

> The code quality is as good as any commercial compiler, IMO.

Which of them do you know (Cosmic, Metrowerks, ICC...)?

I assume you have some experience with GCC/HC12. I also had to decide
which compiler to use but I found that some library functions were
pretty bad. Nevertheless I'm interested how GNU C for the HC12 is
improved.

Could you please tell me how long (CPU cycles) an (unsigned
long)/(unsigned long) division and a (float)/(float) division takes
in the recent version?

If there is still no reasonable int math, I'm afraid that float
division is faster than long (thanks to Tim Housel).

Does the compiler use the 32 bit HC12 operations where possible, e.g.

U16 X, Y, Z;
X = (U16)(((U32)Y * 1000) / (U16)Z);

should use only emul and ediv, no library call.

After all, I really dislike the usage of soft registers (because I
use many interrupts). IMHO, for the HC12 it's not really necessary.

Oliver
--
Oliver Betz, Muenchen



In a message dated 8/8/03 11:06:58 AM Eastern Daylight Time,
writes:
Does the compiler use the 32 bit HC12 operations where possible, e.g.

U16 X, Y, Z;
X = (U16)(((U32)Y * 1000) / (U16)Z);

should use only emul and ediv, no library call.
=================================
This is a result I'd like to see for each compiler.



Hi Oliver,

the problem for an ANSI C compiler with performing

U16 X, Y, Z;
X = (U16)(((U32)Y * 1000) / (U16)Z);

with an EMUL and an EDIV is that if the 32/16 bit EDIV division overflows, then the
HC12 does not generate a result at all (it just sets the V flag). Therefore using a simple EDIV does not generate the same result
for all possible Y and Z's as calculating it with longs.

Our metrowerks compiler does generate the code you are expecting, but only if you are specifying the option -PEDiv. The default is
the save (and slower) long division.
Apart from this, we are also not using any "soft registers".

Bye

Daniel > -----Original Message-----
> From: Oliver Betz [mailto:]
> Sent: Friday, August 08, 2003 17:06
> To:
> Subject: Re: [68HC12] Re: 68hc12 C compiler and assembly instruction set > Mysterious Mister Z wrote:
>
> [GNU C for the HC12]
>
> > The code quality is as good as any commercial compiler, IMO.
>
> Which of them do you know (Cosmic, Metrowerks, ICC...)?
>
> I assume you have some experience with GCC/HC12. I also had to decide
> which compiler to use but I found that some library functions were
> pretty bad. Nevertheless I'm interested how GNU C for the HC12 is
> improved.
>
> Could you please tell me how long (CPU cycles) an (unsigned
> long)/(unsigned long) division and a (float)/(float) division takes
> in the recent version?
>
> If there is still no reasonable int math, I'm afraid that float
> division is faster than long (thanks to Tim Housel).
>
> Does the compiler use the 32 bit HC12 operations where possible, e.g.
>
> U16 X, Y, Z;
> X = (U16)(((U32)Y * 1000) / (U16)Z);
>
> should use only emul and ediv, no library call.
>
> After all, I really dislike the usage of soft registers (because I
> use many interrupts). IMHO, for the HC12 it's not really necessary.
>
> Oliver
> --
> Oliver Betz, Muenchen >
> -------------------- >
> ">http://docs.yahoo.com/info/terms/





wrote:

> U16 X, Y, Z;
> X = (U16)(((U32)Y * 1000) / (U16)Z);
>
> should use only emul and ediv, no library call.
> =================================
> This is a result I'd like to see for each compiler.

well, Cosmic produces this (obviously without the comments):

ldd _Y
ldy #1000 ; works also with a variable
emul
ldx _Z ; works also with a constant value
ediv
sty _X

it's a piece of code I use pretty often for fast (fixed point)
scaling, and I was happy to see that Cosmic produces optimal code.

Oliver
--
Oliver Betz, Muenchen