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

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 (101k points)
retagged by | 55 views

Please log in or register to answer this question.



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

39,481 questions
46,655 answers
139,565 comments
57,344 users