Decompiling VM Code

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Decompiling VM Code

Devo
I've been having a lot of fun with Project 12. Writing big chunks of code in Jack really gives you the sense of sitting way up high on top of the tool chain, and it's neat to think of all the steps the code takes on its way down to the hardware. I like to imagine each line of Jack unraveling into bunches of machine instructions.

After creating my own versions of the various library functions, I've been comparing them to the provided versions. In order to do so, I've been hand-decompiling the provided .vm versions into Jack. This has proven to be quite a challenge, and if you've never tried it I recommend it! It's given me a much better sense of how both the compiler and the VM work. It also provides lots of great 'aha' moments when you see the approach the authors took to the library functions and compare it to your own.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling VM Code

culchie
Well done for getting to Chapter 12! I have not done that one (nor 10 nor 11) but I definitely intend to!
I tend to come and go and when I return to the book I feel the need to redo the earlier stuff which at least has the benefit of improving my knowledge of the earlier chapters.
I think it's impressive that you have moved on to the level where you are decompiling the supplied software.
The other day I caught myself thinking about how an additional register might be built into the CPU (and how this could be accommodated in the machine language etc) and it occurred to me that never would I have imagined myself thinking about designing a CPU before reading this book.


Reply | Threaded
Open this post in threaded view
|

Re: Decompiling VM Code

ybakos
In reply to this post by Devo

Thanks for sharing that tip. A new assignment for my students!