ORG $1000 START: * Initialize registers that will be used to 0 CLR.L D0 CLR.L D1 ;The sum of binariesx CLR.L D2 ;Mutiplication place CLR.L D3 ;The mutiplier *Prompt input from the terminal LEA $3000,A5 LEA $3000,A6 MOVE.B #241,D7 ;Move function #241 to register D7 TRAP #14 ;Input String from the terminal *ASCII to decimal converter MOVEA.L A5,A4 ;Copy the starting address to A4 LOOP: CMPA A6,A4 ;Check if A4 is greater than A6 BGE NEXT ;If A>=A6, done converting and branches to NEXT SUB.B #$30,(A4)+ ;Else subtract the content of A4 by #$30 then increment A4 BRA LOOP *Decimal to binary converter NEXT: MOVEA.L A6,A4 ;Copy the ending address to A4 MOVE.B #1,D3 ;Store mutiplier in D1 MUTIPLICATION: SUBA #1,A4 ;Let A4 point to te end of the String CMPA A5,A4 ;Compare the address of A5 and A4 BLT DONE ;if A4