I am programming a calculator in assembly language with the MSP430g2553. I have a 4x4 membrane keypad and an 2x16 LCD. I already can display numbers in the LCD with the keypad. The issue is that the number has an ascii code. How can I store the decimal or hex value of the number presented in a register so I can add, subtract, multiply or divide it with other number?
You store your numbers internally as binary or BCD and then convert that to ASCII at display time. BCD is easier to convert for display.
For computations the binary representation is likely to be more well suited to calculations you write up yourself following online algorithms.
On the other hand BCD is going to be easier to adapt to computation with larger number of digits than you can represent in the 9 digits you can get with 32-bit binary.