Tag Archives: VM

Issues in writing a VM – Part 3 – State and Memory

When implementing the VM, I had to keep track of state. The state of the VM includes the registers, virtual variables and memory. Fortunately, keeping track of state information is pretty easy. Basically, it amounts to having a dict, where … Continue reading

Posted in Design, Programming, Python | Tagged , , , , | Leave a comment

First Code Transformation: Removing Flag Computations

Short introduction to code transformations If you intend to write a decompiler, you’ll find yourself writing code transformations. In our context, code transformations are operations that take as input an expression tree, and return an equivalent but different expression tree. … Continue reading

Posted in Algorithms, Assembly, decompilation, Programming | Tagged , , , , , , | 1 Comment

Issues in Writing a VM – Part 2

Writing a VM capable of executing expression trees is different from writing a VM for executing assembly instructions. Here I’ll cover several issues stemming from this difference. The first group of issues involve generality. Supporting a specific instruction set is … Continue reading

Posted in Algorithms, Assembly, computer science, Programming, Projects, Python | Tagged , , , , , | 7 Comments

Issues in writing a VM – Part 1

Arkon and I decided to write a VM for vial. First though, a short explanation on what is vial: vial is a project aimed at writing a general disassembler that outputs expression trees instead of text. On top of vial, … Continue reading

Posted in Assembly, computer science, Programming, Projects, Testing | Tagged , , , , , , | Leave a comment

Writing a Quad Interpreter

My compilation homework is writing a compiler from simplified CPL to Quad, a made up assembly language. The compiler was going well, and when it started to emit code, I naturally wanted to test it. The problem is, I work … Continue reading

Posted in Assembly, Compilation, computer science, Personal, Programming, Python | Tagged , , | Leave a comment