I 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 is able to push the acc value to Stack but not able to point to the next location to store the next value. For incrementing am I suppose to use Inc2-pc?

And the pop instruction is popping out the address of the value instead of the value. The implementation of pop is:

ir(4-15)->mar
Stack[SPR]->mdr
mdr->acc
End

Can anyone point out what I am doing wrong? Or any suggestions?

not entirely sure, but it seems to me this is not a Java question. so one thing might be, you've posted in the wrong forum.

Hmmmm i guess so. It is machine language actually.

I have searched all over the Internet for any tutorials/notes on CPU Simulator. Sadly there are none.

How do I remove this post?

you can't "re"move it. admins can move it to a better suited subforum, though.

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.