I am developing a so called simple pep8 program, that converts a base 2 number into base 10.
Below are the requirements:
- Ask for user input in base 2
- Convert the base 2 value into decimal and output that.
- Finally loop and ask user if they want to enter another value. If so ask question again, else display message 'done' (or something to that effect)
So far I am trying to read a character and store this as a string.
Could anyone help!
Thank you.
BR main
letter: .BLOCK 1 ;global variable #1c
;
main: CHARI letter,d ;cin >> letter
LDA 0x0000,i
while: LDBYTEA letter,d ;while (letter != '*')
CPA '*',i
BREQ endWh
CHARO letter,d ; cout << letter
CHARI letter,d ; cin >> letter
BR while
endWh: STOP
.END