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

1 shivajikobardan 0 8/20/2025, 1:35:11 PM
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

Comments (0)

No comments yet