5 days ago
Wed Aug 20, 2025 1:35pm PST
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

comments:
add comment
loading comments...