Ask HN: Implementing instruction in a two-address machine?

I am trying to implement X:=AB+CC in a two-address machine.

I implemented shorter than John P. Hayes in his textbook of Computer Organization and Architecture. So, I suspect I am doing something wrong.

Here's my implementation:

MUL A,B //A=AB

MUL C,C //C=CC

MOVE X,C //X=C

ADD X,A //X=X+A=CC+AB

1 points | by shivajikobardan 6 hours ago

0 comments