# Simple exponents on an HP-16c

I've been on the prowl for an HP-16c for quite some time to add to my rather large calculator collection. My daily driver for the last 25 years is an HP-32SII. Simple, rugged, reliable, and does everything I need it to do.

I stumbled on a kit that runs an emulated HP-16c and took the plunge. It was about 1/4 of the price of even the cheapest original devices on eBay and with an aluminum frame, it looked worth a try. Plus, there's something cool about assembling things yourself.

If I'm being honest, about 90% of the time, I'm on PCalc on my iPhone when I need a calculator.

But there's value in a device made to do only one thing. Also, it's fun. I don't have to explain my art to you Warren!

## It does a lot of programming things and not a whole lot else

It was really the only mainstream calculator targeted at programmers, and it is loved for its one-button base conversion. Vintage Assembly programmers (like yours truly) to a lot of `\$d012` to `53266` stuff.

While it does almost everything an Assembly programmer needs, it curiously lacks ANY scientific functions other than square root and 1/x. This is fine, and I know that cramming functions onto 1982 hardware was quite a task.

Luckily it has a reasonably robust programming environment. So let's write a quick program to do exponents. I happen to do yx quite a bit and it would be nice to have on this thing.

I wrote this out on paper but keeping with my trend of sparing you from deciphering my handwriting...

Enter the programming mode with `P/R` and you probably want to clear the program area.

StepKeystrokesDisplayed CodeNotes
001LBL E43,22, ESet a convenient entry point
002Enter36Push the stack up 1
00311Counter is zero based so count from 15 to 0
004-30
005X<>I42 22Push 15 onto the increment/decrement counter
006X<->Y34Swap places
007STO A44 AStore
008Enter36Push stack up 1
009LBL 043,22, 0Label to loop back to
010X<->Y34Swap
011RCL A45 APut a back in X
012*20
013Enter36Push stack up 1
014DSZ43 23Decrement and go to LBL 0 if not == 0
015GTO 022 0
016RTN43 21Return

To use this remember we're doing yx:

• 2 Enter
• 16
• GSB E

That's it. Pretty easy right? Give it a try.