The code for the implementation of a sub-routine to convert positive numeric data from binary to appropriate character string in a $PDP-11$ like machine has been given below
Note-that $SP$ is the stack pointer and $R_i$ represents $i^{th}$ register respectively.$$\begin{array}{ll}
\text{BTOD :} & \text{MOV} & \text{$(SP){+} , R_O$} & \text{: Save the PC} \\
& \text{MOV} & \text{$(SP) {+}$ , $R_{1}$} & \text{: address of last significant digit of destination} \\
& \text{INC} & R_{1} & \text{: Setting an auto decrement in eighth instruction} \\
& \text{MOV} & \text{$(SP) {+}$ , $R_{3}$} & \text{: Value to be converted} \\
\text{BTOD 1:} & \text{CLR} & R_{2} & \\
& \text{DIV} & 10,R_{2} & \text{: Pair $R_{2}-R_{3}$ receive quotient in $R_{2}$}
\\&& &\text{ and remainder in $R_{3}$} \\
& \text{ADD} & 48,R_{3} \\
& \text{MOVB} & R_{3}, -(R_{1}) & \text{: auto decrement will decrease $R_{1}$} \\
& \text{MOV} & R_{2},R_{3} \\
& \text{BNE} & \text{BTOD 1} & \\
& \text{MOV} & {R_O} - \text{(SP)} & \text{: restore PC} \\ & \text{RTS} & \text{PC} & \text{: return}
\end{array}$$