[Coco] OS9 Pascal

Gene Heskett gene.heskett at verizon.net
Sat Aug 11 21:59:30 EDT 2007


On Saturday 11 August 2007, Willard Goosey wrote:
>>Date: Sat, 11 Aug 2007 04:41:02 -0400
>>From: Gene Heskett <gene.heskett at verizon.net>
>>
>>The $87CD then doesn't have a crc, but it does have an 8 bit checksum in
>>normal os9 style.

Here, I as referring to the header only, there is room also for a crc too, but 
over only 8 or 10 bytes it hardly seems worth the effort. :(

>Not quite.  The module PCODE, complete, is only 24 bytes long.
>Including the crc ($5c2b50).  The actual p-code is stuck on the end
>like xmodem padding.  As far as I can tell, the same module is at the
>beginning of every Pascal "binary".  Same length, same crc.
>
>>Oh Fudge.  I'd have to assume then that the rest of that PCODE module would
>>have a normal os9 crc attached at the end.
>
>Yes, PCODE is a regular module, with a CRC and everything.  But it's
>just a header.  The actual p-code isn't in a module, and ends with a
>symbol table.
>
>I'm not saying the p-code itself doesn't have a structure to it, but
>it's not an OS-9 module and it's not documented in any docs *I* have.

Ditto, including the shacks manual sitting on the shelf above me.

>>AFAIK, os9 doesn't skip doing the crc if it finds the language byte
>>is pascal.
>
>I'm not sure how this all works.  Pesumably, OS9 loads the PCODE
>module, scans the rest of the file and finds no more modules, does the
>crc check, then loads one of the pcode interpeters and passes control
>on to that.

Actually, I believe it will do the crc check over the reported size of the 
module, and then look for more modules in the remaining length of the file.
Not finding any, I'd assume it just goes to look for something else to do, 
like hand it off to the interpreter.

>I don't know if the pcode engine is passed an open file descriptor to
>the "binary", or if it uses argv[0] (as a C hacker would say) and
>re-opens the file, or does something else.
>
>Pascal_Compiler, for instance, is a 59K file.  You're not going to
>load the entire image into RAM first, not under Level 1!
>
>I wanted to figure this out at one point, since I had another old
>compiler (that produced an intermediate code) that I was trying to
>port to OS-9, but that project died a couple of hard drive crashes
>ago. :-(
>
>>IZZAT what its all about?  I knew there was some reason I couldn't
>>get my head around that language.  I'm sorry, but generally speaking,
>>I want to know what every byte does.
>
>Well, if you knew what every byte does, you might do something wrong.

Not impossible Willard, but with my approach, chances are pretty slim.

>"The compiler won't let you shoot yourself in the foot."

The MW C compiler?  Donbesilly.  Its entirely possible to wound oneself with 
it.  Probably not with the usual printf("Hello world/n");, but eventually you 
WILL, and then you'll spend 3 days staring at the code before it hits you, 
usually right between the eyes...

The Pascal compiler?, 100% guaranteed, the docs suck the big one.

>>I wonder if the PCODE header does that somehow already?
>
>Not that I can tell.
>
>Willard



-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
There's some entertainment value in watching people juggle nitroglycerin.
             -- Larry Wall in <199712041747.JAA18908 at wall.org>



More information about the Coco mailing list