am using CPU Sim to change wombat1 to wombat2 by adding stack.

I have done adding a Stack RAM and a Stack pointer SPR.

I have implemented a push instruction as such:
acc->mdr
mdr->stack(spr)
End

The implementation of push instruction is able to push the acc value to Stack but not able to pop the value from stack to acc for output.
And the pop instruction implemented below is popping out the address of the value instead of the value. The implementation of pop is:

spr-decr
stack(spr) ->mdr
mdr->acc
End

what have i done wrong? Or any suggestions?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.