On Thu, 2001-10-11 at 19:49, Dan Sugalski wrote:
> At 06:05 PM 10/11/2001 -0400, Gregor N. Purdy wrote:
> >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.
>
> Are you sure it's not just stolen? Some of us do have extensive (if really,
> really old) experience with macro assemblers :)
>
> >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.
>
> Heh. Well, too bad--use S0 and get string register 0. I'm OK with that.
>
> >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.
>
> While I think I'd prefer * as the PC indicator, @ is OK and it won't
> conflict with constant arithmetic someone might want to do.
>
Since we're passing guilt around, there's an equate of '*' which is the
current PC...and I didn't document it. You can do
set I1,*
and it will set I1 to the current PC. It doesn't allow any math,
though. I thought about hooking up eval to various brackets but I never
got the time before my job got busy...
> I think we need some opcode that'll fetch the current PC and stick it in a
> register. Maybe:
>
> getpc I0
>
> to put the PC for the next instruction into I0.
>
Sort of what happens above, though its one off.
> Having "fake" opcodes would be useful, like so:
>
> getlabelabs I0, FOO
>
> to put the absolute address of the label FOO into I0, which'd probably
> translate into:
>
> getPC I0
> add I0, I0, FOO
>
> or something like that.
>
Though I like Gregor's way of doing it: we know the addresses (more or
less) at compile time, so we might as well not waste ops doing
arithmetic that we know in advance...
Brian
> Dan
>
> --------------------------------------"it's like this"-------------------
> Dan Sugalski even samurai
> [EMAIL PROTECTED] have teddy bears and even
> teddy bears get drunk