# Just Launched: You can now import projects and releases from Google Code onto SourceForge

We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps.

## 8051: square or power function?

Help
Rabis49
2010-05-01
2013-03-12

• Rabis49
2010-05-01

Hi,
#define x2      1
#define baud 19200
#define xtal    22118400

#if (x2 == 1)
CLKREG = 0x01;
#else
CLKREG = 0x00;
#endif

Okay.
Now I need the power function  ( … 2^x2 … 2**x2 …. potenz(2;x2) ….. ????)

Is there a way  to solve this problem for the following calculation?

BRL = 256-(xtal/baud/192) * 2^x2 ; <- thats wrong

(It's for a AT89S8253)
Thanks for ideas, help & answers

Rabis49

• Maarten Brock
2010-05-02

There is no power of operator in C. There is a pow function but that won't help here.
But I guess x2 can have only two values so I'm sure you can think of a different formula.

• Rabis49
2010-05-04