Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
IMCC, PASM and constants/macros
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Clinton A. Pierce  
View profile  
 More options May 26 2003, 7:48 pm
Newsgroups: perl.perl6.internals
From: cli...@geeksalad.org (Clinton A. Pierce)
Date: Mon, 26 May 2003 18:55:55 -0400
Local: Mon, May 26 2003 6:55 pm
Subject: IMCC, PASM and constants/macros
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?  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will Coleda  
View profile  
 More options May 27 2003, 4:48 am
Newsgroups: perl.perl6.internals
From: w...@coleda.com (Will Coleda)
Date: Mon, 26 May 2003 23:57:42 -0400
Local: Mon, May 26 2003 11:57 pm
Subject: Re: IMCC, PASM and constants/macros
Perhaps "macros only work in assembler mode" is the issue?

http://www.mail-archive.com/perl6-intern...@perl.org/msg14107.html

Regards.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 27 2003, 5:48 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Tue, 27 May 2003 08:18:08 +0200
Local: Tues, May 27 2003 2:18 am
Subject: Re: IMCC, PASM and constants/macros
Clinton A. Pierce <cli...@geeksalad.org> wrote:

> Is there a reason that .constant (which seems implemented in .macro) can be
> used in .pasm files, but not .imc files?   Can it be?

.constant is the old (untyped) PASM syntax. IMCC has .const:

.const int ID = 42

HTH
leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clinton A. Pierce  
View profile  
 More options May 27 2003, 8:48 am
Newsgroups: perl.perl6.internals
From: cli...@geeksalad.org (Clinton A. Pierce)
Date: Tue, 27 May 2003 08:01:51 -0400
Local: Tues, May 27 2003 8:01 am
Subject: Re: IMCC, PASM and constants/macros
At 11:57 PM 5/26/2003 -0400, Will Coleda wrote:

>Perhaps "macros only work in assembler mode" is the issue?

>http://www.mail-archive.com/perl6-intern...@perl.org/msg14107.html

>Regards.

It was, but I was looking for the "why" of it.  Leo answered that ("IMCC
has .const") so I'm all set now.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bryan C. Warnock  
View profile  
 More options May 27 2003, 5:48 pm
Newsgroups: perl.perl6.internals
From: bwarn...@raba.com (Bryan C. Warnock)
Date: 27 May 2003 17:45:18 -0400
Local: Tues, May 27 2003 5:45 pm
Subject: Re: IMCC, PASM and constants/macros

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?

> >http://www.mail-archive.com/perl6-intern...@perl.org/msg14107.html

> >Regards.

> 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?

--
Bryan C. Warnock
bwarnock@(gtemail.net|raba.com)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 28 2003, 6:48 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Wed, 28 May 2003 08:23:22 +0200
Local: Wed, May 28 2003 2:23 am
Subject: Re: IMCC, PASM and constants/macros
Bryan C. Warnock <bwarn...@raba.com> wrote:

> Is there is reason not to s/\.constant/.const/g for consistency's sake?

The difference is, that PASM did define an untyped variant:

  .constant FOO 42

PIR Syntax is:

  .const int FOO = 42

I'm ok with tossing the PASM variant, its barely used (only in macro.t)
and changing assemble.pl should be easy.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clinton A. Pierce  
View profile  
 More options May 28 2003, 11:48 am
Newsgroups: perl.perl6.internals
From: cli...@geeksalad.org (Clinton A. Pierce)
Date: Wed, 28 May 2003 11:13:45 -0400
Local: Wed, May 28 2003 11:13 am
Subject: Re: IMCC, PASM and constants/macros
At 05:45 PM 5/27/2003 -0400, you wrote:

>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?

> > >http://www.mail-archive.com/perl6-intern...@perl.org/msg14107.html

> > >Regards.

> > 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clinton A. Pierce  
View profile  
 More options May 28 2003, 11:48 am
Newsgroups: perl.perl6.internals
From: cli...@geeksalad.org (Clinton A. Pierce)
Date: Wed, 28 May 2003 11:21:01 -0400
Local: Wed, May 28 2003 11:21 am
Subject: Re: IMCC, PASM and constants/macros
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.  :)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 28 2003, 2:00 pm
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Wed, 28 May 2003 18:43:52 +0200
Local: Wed, May 28 2003 12:43 pm
Subject: Re: IMCC, PASM and constants/macros
Clinton A. Pierce <cli...@geeksalad.org> wrote:

> And actually, on further consideration, .const isn't what I want
> either.

You are looking vor .sym/.local:

.local PerlHash BASICARR
.sub _main
        BASICARR = new PerlHash
        .arg "value"
        .arg "x"
        call _DIMENSION
        .arg "x"
        call _ARR_LOOKUP
        .local string res
        .result res
        print res
        end
.end
.sub _DIMENSION         # void DIMENSION(string array)
         saveall
         .param string key
         .param string value
         BASICARR[key] = value
         restoreall
         ret
.end
.sub _ARR_LOOKUP                # string ARR_LOOKUP(string key)
         saveall
         .param string key
         $S0 = BASICARR[key]
         .return $S0
         restoreall
         ret
.end

This is similar to yours, except, I used a PerlHash (you seem to like
store/retrieve strings).

This works with this patch to imcc (identifiers where not considered as
array/hash keys):

--- ../parrot/languages/imcc/pbc.c      Wed May 14 17:37:08 2003
+++ languages/imcc/pbc.c        Wed May 28 18:36:34 2003
@@ -615,6 +615,7 @@
         if (r->reg)
             r = r->reg;
         switch (r->type) {
+            case VTIDENTIFIER:       /* P[S0] */
             case VTPASM:       /* P[S0] */
             case VTREG:        /* P[S0] */
                 if (r->set == 'I')

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bryan C. Warnock  
View profile  
 More options May 28 2003, 9:48 pm
Newsgroups: perl.perl6.internals
From: bwarn...@raba.com (Bryan C. Warnock)
Date: 28 May 2003 21:35:55 -0400
Local: Wed, May 28 2003 9:35 pm
Subject: Re: IMCC, PASM and constants/macros

On Wed, 2003-05-28 at 11:13, Clinton A. Pierce wrote:

> >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.

Which doesn't invalidate my question.  :-)

--
Bryan C. Warnock
bwarnock@(gtemail.net|raba.com)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »