I'm having a really awful bootstrapping problem here. I've got the core of BASIC producing *documented* valid IMCC, but I can't test it because I'm stumped as to how to roll the portions that need to be in PASM.
The runtime has some bits in it that are more easily hand-rolled in IMCC-ish PASM. For example, I'm going to redo all of BASIC's standard library of builtins and whatnot to use the Current Calling Conventions. There are some parts of a BASIC runtime that need to exist as long-lived globals (DATA's data, DIM values, screen positioning information, etc..) that I've got stashed in a few PMC's.
I'd *like* to salvage my sanity and refer to these things with meaningful names (DATAINDEX instead of P16) and at the same time use the IMCC goodness to put the library together. But I can't mix IMCC and PASM in any meaningful way if there are constant directives.
Is there a reason that .constant (which seems implemented in .macro) can be used in .pasm files, but not .imc files? Can it be?
On Monday, May 26, 2003, at 06:55 PM, Clinton A. Pierce wrote: > I'm having a really awful bootstrapping problem here. I've got the > core of BASIC producing *documented* valid IMCC, but I can't test it > because I'm stumped as to how to roll the portions that need to be in > PASM.
> The runtime has some bits in it that are more easily hand-rolled in > IMCC-ish PASM. For example, I'm going to redo all of BASIC's standard > library of builtins and whatnot to use the Current Calling > Conventions. There are some parts of a BASIC runtime that need to > exist as long-lived globals (DATA's data, DIM values, screen > positioning information, etc..) that I've got stashed in a few PMC's.
> I'd *like* to salvage my sanity and refer to these things with > meaningful names (DATAINDEX instead of P16) and at the same time use > the IMCC goodness to put the library together. But I can't mix IMCC > and PASM in any meaningful way if there are constant directives.
> Is there a reason that .constant (which seems implemented in .macro) > can be used in .pasm files, but not .imc files? Can it be?
On Tue, 2003-05-27 at 08:01, Clinton A. Pierce wrote: > At 11:57 PM 5/26/2003 -0400, Will Coleda wrote: > >Perhaps "macros only work in assembler mode" is the issue?
>On Tue, 2003-05-27 at 08:01, Clinton A. Pierce wrote: > > At 11:57 PM 5/26/2003 -0400, Will Coleda wrote: > > >Perhaps "macros only work in assembler mode" is the issue?
> > It was, but I was looking for the "why" of it. Leo answered that ("IMCC > > has .const") so I'm all set now.
>Is there is reason not to s/\.constant/.const/g for consistency's sake?
And actually, on further consideration, .const isn't what I want either. What I really want is a #define directive for general-purpose (simple) compile-time substitutions. For example, to refer to a Px register that I'm going to need on-and-off through a program's life to manage BASIC's internal stuff.
# These are vastly simplified, but give you the idea .define BASICARR $P9999 .sub _DIMENSION # void DIMENSION(string array) saveall .param string array new $P0, .PerlArray BASICARR[array] = $P0 restoreall .end .sub _ARR_LOOKUP # string ARR_LOOKUP(string key) saveall .param string key set $S0, BASICARR[key] .return $S0 restoreall .end
At 11:13 AM 5/28/2003 -0400, Clinton A. Pierce wrote:
># These are vastly simplified, but give you the idea
And of course, by "vastly simplified" I meant "completely wrong" because the sample shown won't work because of the saveall and restoreall before and after the array creation in _DIMENSION. But you still get the idea. :)