The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
0 votes

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.

BTOD: MOV (SP)+, RO : Save the PC
  MOV (SP)+, +R1 : address of last significant digit of destination.
  INC R1 : Setting an autodecrement in eighth instruction
  MOV (SP)+, R3 : Value to be converted
BTOD 1: CLR R2  
  DIV 10.R2 : Pair R2-R3 receive quotient in R2 and remainder in R3.
  ADD 48, R3  
  MOVB R3, -(R1) : autodecrement will decrease R1
  MOV R2, R3  
  BNE BTOD 1  
  MOV RO-(SP) : restore PC
  RTS PC : return
asked in CO & Architecture by Veteran (115k points)
retagged by | 68 views

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,129 questions
53,252 answers
70,506 users