Fog Creek Software
Discussion Board


Many compilers of Microsoft used to generate p-Code. Is there any documents about the internals of p-Code? Are p-Code compilers still available now?

Friday, December 13, 2002

P-Code isn't unique to microsoft, and I suspect that MS had many different "flavors" of P-Code.

P-Code is just middle-layer code - more assembly-ish than Visual Basic, less assembly-ish than 8086-hex.

You could call .Net's Common Language Runtime (CLR) ( - "P-Code" if you wanted to.

Java Byte Code is P-Code.  That's pretty well documented; I'd start there if I was in your shoes ...


Matt H.
Friday, December 13, 2002

Basically, the concept of p-code is simple. The compiler generates some intermediate bytecode and a virtual machine interprets it in run-time. The first successful and popular imlementation of this idea was UCSD Pascal, in 70-s.

The latest examples of p-code are Java bytecodes and MSIL in .NET. There are some differences... For example, MSIL code is never interpreted; it's always converted into machine code prior to execution. But the main idea is still the same.

Igor K.
Friday, December 13, 2002

When I said CLR above, I ment MSIL.


Matt H.
Friday, December 13, 2002

Kernighan and Pike's "The Practice of Programming" has a good, gentle introduction to "bytecode"-style virtual machine concepts.

Dan Maas
Friday, December 13, 2002

Sorry guys, I know what p-Code is in theory. I was just asking for details about Microsoft's p-Code. Can you give me some links/pointers? Thanx

Saturday, December 14, 2002

*  Recent Topics

*  Fog Creek Home