Wanna ask some question of our computer structure exam here to be sure. Below is add command of Mic-1 IJVM. We were asked to write new iaddtriple
command which will add three top words of stack and store it on the stack again.
iadd1 MAR = SP = SP − 1; rd Read in next-to-top word on stack
iadd2 H = TOS H = top of stack
iadd3 MDR = TOS = MDR + H;wr;go to Main1 Add two top words, write to top of stack
My answer was ;
iaddtriple1 MAR = SP = SP − 1; rd
iaddtriple2 H = TOS H =
iaddtriple3 H = MDR = TOS = MDR + H
iaddtriple4 MAR = SP = SP − 1;
iaddtriple5 MDR = TOS = MDR + H ; wr;go to Main1
I want to ask if my iaddtriple3
step is legal. One of my friends told me that H=blabla +H
assignment should be illegal thus shouldn't be used. But time diagram of a data path cycle proves me right. Thanks in advance.
iaddtriple3 H = MDR = TOS = MDR + H