simple-virtual-machine icon indicating copy to clipboard operation
simple-virtual-machine copied to clipboard

Should not post inc the ip

Open evanxg852000 opened this issue 6 years ago • 2 comments

https://github.com/parrt/simple-virtual-machine/blob/2e8c0186d1cfc90043bd1e3e085bd317801a9378/src/vm/VM.java#L91

The ip should not be moved forward after updating it ip = code[ip];

evanxg852000 avatar Jul 26 '19 07:07 evanxg852000

Ah good point. That's a waste of an increment. no doubt I was just being consistent or maybe it was a cut-and-paste error . haha

parrt avatar Jul 26 '19 17:07 parrt

👍 But again thanks for the work in compilers. Especially the book "Language Implementation Patterns" I got it back in 2011 and still read it today. I was actually revisiting this talk and implementing the svm while learning rust.

evanxg852000 avatar Jul 26 '19 18:07 evanxg852000