The program must start at address x3000. Here's how the program must behave:
1. The program waits for a character to be typed on the keyboard. (Use GETC to read the character; it
will be placed in R0.)
2. If the character is a digit ('0' through '9'):
d) Convert the character to its corresponding decimal value. In other words, '0' becomes zero, '1'
becomes 1, ... '9' becomes 9. Let's call that value R (for "run length").
e) Wait for another character (using GETC).
f) Print R copies of that character to the console. (Use OUT to print one character, and do this R
times. The character to be printed must be in R0 when OUT is called.)
g) Go back to Step 1.
3. Else, if the character is Enter/Return (ASCII #10): Print a linefeed (ASCII #10) to the console, and
go back to Step 1.
4. Else, if the character is anything else, halt the program. (Use HALT.)