Dan, Sam, All --

> > Did we put a patch into parrot that lets you fetch the current PC
and store
> > it in an integer register? I seem to recall someone did, but I can't find it.
> 
> That's the '@' thing I was talking about making a doc patch for.  I then
> realized that I didn't understand it well enough to explain it!  The
> little I grok is that a '@' in the assembly gets replaced by the value of
> $op_pc.  Jako does stuff like:
> 
>    set      I31, [ printit - @ - 3 ]
> 
> For function calls.  As I thought about documenting '@' I realized I had
> no idea what those braces are for...  Seems to me whoever put in this
> hack should be the one to document it.

I'm guilty.

I needed address arithmetic for Jako subroutine support. I also needed
a quick and easy way to detect it in the .pasm file. I use the square
brackes as a quotation device to make it easy to parse. Eventually
we will need an assembler with a syntax that is *designed* rather
than *evolved* (this is not intended as a disparaging comment), at
which point the syntax for various constructs would be up for grabs.
For example, I think registers should start with '%' or some other
sigil, since I could very reasonably want to use a label that looked
like a register reference.

Anyway, we definitely should have address arithmetic documented in
the assembler docs, and I should have written it right at the outset,
but I forgot. Right now, I'm in the middle of a moby patch (as I
indicated in my message to the list earlier today) having to do with
refactoring all the stuff related to opcode tables and definitions
and code transformations. Things are working pretty well right now,
although I'm not yet passing all the tests.

Once I complete moby.patch, I can update the assembler docs, unless
someone beats me to it. In the mean time, I'm hoping the above at
least lets you understand it a bit. You can use labels, constants,
@ and +/- in your address arithmetic. Enjoy.


Regards,

-- Gregor
 _____________________________________________________________________ 
/     perl -e 'srand(-2091643526); print chr rand 90 for (0..4)'      \

   Gregor N. Purdy                          [EMAIL PROTECTED]
   Focus Research, Inc.                http://www.focusresearch.com/
   8080 Beckett Center Drive #203                   513-860-3570 vox
   West Chester, OH 45069                           513-860-3579 fax
\_____________________________________________________________________/

Reply via email to