     EXT            # enable extended mode

     INA            # take and store the character input
     STO  c
     IN             # take the number input
loop BRZ  exit      # if zero, go to the exit
     STO  n         # store whats in the register
     LDA  c         # load and output the character
     OTA
     LDA  n         # load the counter
     SUB  one       # subtract one
     BR   loop      # otherwise, go to the start of the loop

exit LDA  nl        # load and output nl
     OTA
     HLT            # stop

# state
c    DAT  000       # the inputted character
n    DAT  000       # the inputted number

# constants
one  DAT  1
nl   DAT  010       # the new line character ('\n')
