mucan54 / 8051-simulator

Data Memory Simulator of 8051 Assembly codes
GNU General Public License v3.0
7 stars 2 forks source link

any idea on how to add the push and pop instruction simulation #1

Closed asmwarrior closed 2 years ago

asmwarrior commented 2 years ago

I would like to use this simulator for teaching.

I can generate many asm files (which contains some random numbers) in the asm instructions. Then I can send those files to my students, and the students can verify the code, and give the results.

I can check whether their answer is correct or not by this simulator.

So, any idea to implement the pop and push command? which need to implement a special sfr SP.

Thanks.

mucan54 commented 2 years ago

Can you send me a documentation to how it should work, then I can implement soon.

kimstik commented 2 years ago

https://www.keil.com/support/man/docs/is51/is51_push.htm should help you

asmwarrior commented 2 years ago

Yes, @kimstik gives the correct document. Thanks.

kimstik commented 2 years ago

One more reference example is "cl_51core::instruction_c0" in https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/sim/ucsim/s51.src/mov.cc

asmwarrior commented 2 years ago

I implement this feature, see here:

add support for the push and pop instruction and many other improvement by asmwarrior · Pull Request #4 · mucan54/8051-simulator

mucan54 commented 2 years ago

Thank you.