Calculator

There is a basic mini hex calculator built in.  It can do Addition, Subtraction, Division, Modulus, bit-wise And, bit-wise Or, bit-wise Exclusive Or, and bit-wise Negation, with Values, Register and Symbols.  It will display results in Hex, Binary, Decimal, and as a Character (single quoted.)



Op

Name

Effect

+

Plus

Addition.

-

Minus

Subtraction.

%

Percent

Calculate remainder (modulus).

/

Forward Slash

Calculate quotient.

&

Ampersand

Bit-wise AND.

|

Pipe

Bit-Wise (inclusive) OR.

^

Caret

Bit-Wise (exclusive) OR, also called XOR.

!

Exclamation

Bit-Wise NOT.



Notes:



Input

Effect

CALC 9+1

Calculate 9+1, in hex.

R A 1

Set Accumulator to 1.

R X 2

Set X to 2.

R Y 3

Set Y to 3.

CALC A+X+Y

Calculate sum of registers.

CALC 1FF-S

Calculate Stack Depth.

CALC BRKV+1

Calculate address of Break Vector + 1
(First byte is a jump instruction.)

CALC A+#A

Calculate Accumulator plus (decimal) 10.

CALC A+0A

Calculate Accumulator plus (decimal) 10.

CALC A+$0A

Calculate Accumulator plus (decimal) 10.

CALC 0A+0A

Calculate 10 + 10, in hex.

CALC $RESET+1

Calculate Address of Reset + 1 (First opcode is one byte, CLD).

CALC !HOME

Calculate bit-wise NOT.

CALC X & Y

Calculate bit-wise AND of Register X , Register Y.

CALC X | Y

Calculate bit-wise OR of Register X , Register Y.

CALC X ^ Y

Calculate bit-wise XOR of Register X , Register Y.

CALC X / Y

Calculate division of Register X , Register Y.

CALC X % Y

Calculate remainder of Register X , Register Y.