Multiplication Algorithm for Base 2

The user will type in a string of binary digits: 10101100. The program will read this as a string of ASCII characters, since that is the only way the computer knows how to read input from the keyboard (function 0AH, int 21h). Therefore, the input will be stored in the computer as an array of bytes. Each byte will represent one of the digits: 30h = '0', 31h = '1'.
31 30 31 30 31 31 30 30
 Your program should then convert each ASCII byte into the number that it represents: 31h to 1, 30h to 0.
1 0 1 0 1 1 0 0
Then it is time to calculate the number that is represented by the string. Whenever converting from a string to a number, use the Multiplication Algorithm
  1. Intialize a total to 0.
  2. Process the string from left to right.
  3. Multiply the total by the base, and add the next available digit to the total.
  4. Continue step 3 for all the digits.

Here is the Multiplication Algorithm for this string:
NewTotal = OldTotal*2 + Next Digit Next Digit
(Rightmost Used Digit)
Used Digits Unused Digits
Initialized to 0 None None 10101100
1 1 1 0101100
2 0 10 101100
5 1 101 01100
10 0 1010 1100
21 1 10101 100
43 1 101011 00
86 0 1010110 0
172 0 10101100 None

After all the digits have been processed, the Total holds the number that is equivalent to the original string.

Note: Do not be confused by the base that is used to represent the total, it is irrelevant. It is only important to understand that by doing the arithmetic, a number has been generated from a string. If humans are doing the conversion, then  numbers will be represented in based 10. If the computer is doing the conversion, then numbers are stored in base 2.