2.3 A Virtual Machine for Simple

The virtual machine VM1, given in C source code vml. c, executes a code given in VM1 “assembly” language form. It has a live display, which shows contents of all the machine registers and some portion of the memory, for execution of each instruction. It uses POSIX threads and ncurses, a CRT text screen handling package, which optimizes the operations for repeated updates. See Fig.2.4 for a typical display.

 

 VM1 Machine Simulator IP: 10000 IR: ef000000 A: 2345 M : 0 BP: 0 SP: 2345 500000a 501000c 54e0001 600000d 506000d ef000000 0 0 0 0 2345 1234 a 2345 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

Get Compilers: Principles and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.