##### BASES

CalcTastic’s programmer mode can display everything in one of four bases: **binary**, **octal**, **decimal** or **hexadecimal**. Press and hold the corresponding button for the base you want to switch to. The current base is always highlighted on the keyboard:

BIN, OCT, DEC or HEX

All screens and pop-up windows in the programmer mode will print values in the current base. Here is an example of a calculation performed in decimal:

1 + 2 × 3 = 7

and then how it would look if you switched to binary:

1 + 10 × 11 = 111

##### INTEGER SIZES

CalcTastic can perform calculations in one of **eight** different integer-sizes (four signed & four unsigned). Press and hold the corresponding button for the size you want to switch to. The current integer-size will always be highlighted on the keyboard:

S08, S16, S32, S64

U08, U16, U32, U64

You can cast a number from one size to another, just like you would in many programming languages (ie Java, C++). Each input type is a bit different:

**Algebraic:**

- Perform a calculation in one size, change sizes, then tap on the value from your history. It will get casted to the current size.
- Same will work for tapping on an item in
**memory**that was saved in a different size.

**RPN:**

- Enter any number of items onto the stack and just change sizes. The entire stack will get casted to the new size.
- Tap on any item in
**history**or**memory**that was saved in a different size. It will get casted to the current size when put onto the stack.

Here we’ll replicate casting a Java **Integer** to a **Short** (in DECIMAL). First, enter the number in the starting base. A Java **Integer** is a 32-bit signed integer:

S32451,800,364=

Then switch to the new size (and tap on the previous result in Algebraic) and you’ll see the newly casted value. A Java **Short** is a 16-bit signed integer:

S16-4,820

The **current calculation**, all **values on the stack** and the **M-position** memory register all live in the current integer size. All calculations in your history (and memory registers 1-9) will be saved with the integer-size that it was performed in. Here’s some examples you may see in the history (in HEX):

S16: 1 + 2 × 3 = 7

U64: FF | (25 x 14) << 13 = 1720 00FF

##### BINARY BIT DISPLAY

In programmer mode, you can toggle the **binary bit-display** at any time by pressing the BITS button. With the bit-display open, you can press any half-byte nibble, which will open an expanded view of those bits, allowing you to toggle them as well. This allows you to enter or modify numbers with ease. Below is a screenshot:

##### OTHER FUNCTIONS

The rest of the functions in the programmer-mode are fairly easy to use, so my goal here is to simply give an example (or two) of each. These examples will all be done using **signed 64-bit** integers and in **hexadecimal**. Press and hold S64 followed by Hex to set this up and CLR before each example:

What is 789 & CBC?

CLR789AndCBC=S64: 488

What is 789 | CBC?

CLR789OrCBC=S64: FBD

What is 789 ^ CBC?

CLR789XorCBC=S64: B35

What is 3A745 << 2?

CLR3A745<<<<S64: E 9D14

or…

CLR3A745LSH2=S64: E 9D14

What is 3A745 >> 2?

CLR3A745>>>>S64: E9D1

or…

CLR3A745RSH2=S64: E9D1

What is the 1’s complement of 77?

CLR1’s77=S64: FFFF FFFF FFFF FF88

What is the 2’s complement of 77?

CLR2’s77=S64: FFFF FFFF FFFF FF89

What is 3 & ~3?

CLR3AndNot3=S64: 0

How do I flip the bytes in AABB CCDD?

CLRF08AABBCCDD=S64: DDCC BBAA 0000 0000

How do I flip the words in AABB CCDD?

CLRF16AABBCCDD=S64: CCDD AABB 0000 0000

What is 285A mod 34?

CLR285AMod34=S64: 22

How can I get a random integer?

CLRRandom=

##### ORDER OF OPERATIONS

If you omit parenthesis, here is the order of operations for the Programmer Mode:

- Anything on the same line has equal priority (as other items on that line)
- Anything below has lower priority
- Anything above has higher priority

9 – ()

8 – x² y^{x}

7 – × ÷

6 – + −

5 – Mod

4 – LSH RSH

3 – And

2 – Xor

1 – Or

*Implicit multiplication has the same priority as regular multiplication.