Micro-assembly language how to do loop arithmetic shift right

77 views Asked by At
ixor1   MAR = SP = SP - 1; rd       // takes next to word on stack 
ixor2   OPC = TOS                  // OPC is number of bits to shift       2
ixor3   H = MDR                    // H is the number to be shifted       5
// What i need to do is arithmetic shift right value in H by TOS 
// for example if my TOS stored in opc is 2 and H = 5 I am trying to do 5 >> 2 
// however the architecture only allows arithmetic shift right >> by 1 . I was thinking of just looping 
// H = H >> 1   5 times or OPC no. of times how would I implement that ?
ixor4   H = H >> 1
ixor5   MDR = TOS = H; wr; goto Main1  // sets MDR AND TOS as H and goes back to Main code 

What i need to do is arithmetic shift right value in H by TOS. for example if my TOS stored in opc is 2 and H = 5 I am trying to do 5 >> 2 however the architecture only allows arithmetic shift right >> by 1 . I was thinking of just looping H = H >> 1 5 times or OPC no. of times how would I implement that ?

0

There are 0 answers