Handout No. 7

CS 4110 Compiler Design
Istvan Simon
 
Describes the PL ideal abstract machine
Other Handouts
back   next   notes
The PL abstract machine is very similar to The Abstract Machine  described in the notes.  This is not surprising, since PL is also a block structured language, just like Pascal is. PL is however simpler than Pascal, and this is reflected in the PL abstract machine which is also simpler.

 Architecture

The architecture of the PL machine is identical to that of the Pascal machine.  It's memory consists of an array of integer words, addressed from 1 to some maximum. It has the same three registers  that the Pascal machine has, namely pc, arp,  and  top,  and these are used the same way.

Instruction Set

We describe briefly each instruction of the PL machine. Each item starts with the integer opcode of the instruction, followed by its assembly language representation, followed by a brief description of the instruction. To define the opcodes in your compiler, define an enumerated type with the names of the instructions suffixed by 4, e.g. Add4, And4,  Arrow4,  etc. in alphabetical order.  PL has 27 instructions, so the opcodes will go from 0 to 26.  

If you have comments or suggestions, email me at simon@csuhayward.edu