[Coco] OS9 Pascal
Willard Goosey
goosey at virgo.sdc.org
Sat Aug 11 17:17:41 EDT 2007
>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.
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.
>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.
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.
"The compiler won't let you shoot yourself in the foot."
>I wonder if the PCODE header does that somehow already?
Not that I can tell.
Willard
--
Willard Goosey goosey at sdc.org
Socorro, New Mexico, USA
"I've never been to Contempt! Isn't that somewhere in New Mexico?"
--- Yacko
More information about the Coco
mailing list