Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Somebody's terminal is dropping bits. I found a pile of them over in the corner.


devel / comp.lang.forth / gFORTH Metal Compiler ( or attempt at building one )

SubjectAuthor
* gFORTH Metal Compiler ( or attempt at building one )SpainHackForth
`* Re: gFORTH Metal Compiler ( or attempt at building one )Gerry Jackson
 +* Re: gFORTH Metal Compiler ( or attempt at building one )Brian Fox
 |`- Re: gFORTH Metal Compiler ( or attempt at building one )SpainHackForth
 `* Re: gFORTH Metal Compiler ( or attempt at building one )SpainHackForth
  `* Re: gFORTH Metal Compiler ( or attempt at building one )SpainHackForth
   +- Re: gFORTH Metal Compiler ( or attempt at building one )SpainHackForth
   `* Re: gFORTH Metal Compiler ( or attempt at building one )Brian Fox
    +- Re: gFORTH Metal Compiler ( or attempt at building one )SpainHackForth
    `* Re: gFORTH Metal Compiler ( or attempt at building one )SpainHackForth
     `- Re: gFORTH Metal Compiler ( or attempt at building one )Brian Fox

1
gFORTH Metal Compiler ( or attempt at building one )

<194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24388&group=comp.lang.forth#24388

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:a0c:b0:63d:44c5:3f37 with SMTP id dw12-20020a0562140a0c00b0063d44c53f37mr173354qvb.12.1692814821244;
Wed, 23 Aug 2023 11:20:21 -0700 (PDT)
X-Received: by 2002:a05:6a00:2da4:b0:68b:a137:3738 with SMTP id
fb36-20020a056a002da400b0068ba1373738mr1862896pfb.5.1692814820925; Wed, 23
Aug 2023 11:20:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 23 Aug 2023 11:20:20 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=88.1.142.7; posting-account=oUnEFAoAAADoKEMDaPmswUef8xS_aFfv
NNTP-Posting-Host: 88.1.142.7
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
Subject: gFORTH Metal Compiler ( or attempt at building one )
From: jemo07@gmail.com (SpainHackForth)
Injection-Date: Wed, 23 Aug 2023 18:20:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2823
 by: SpainHackForth - Wed, 23 Aug 2023 18:20 UTC

Hello all,

I having some issue with some code I'm using to have a go at meta compilation, I'm building a 32 bit 'Target' and when I try to write some bytes into the Target which I have alloted space for, it just won't show up.

Here is it is interactive in gForth:

Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
CREATE TARGET 64 ALLOT ok
TARGET 64 ERASE ok
ok
\ Lets add a word to examine our target: ok
ok
: .## ( c) 0 <# # # #> TYPE SPACE ; ok
: REVIEW compiled
BASE @ >R HEX \ Show target addess space. compiled
2 0 DO CR 32 0 DO J 32 * I + TARGET C@ .## LOOP LOOP compiled
R> BASE ! ; ok
ok
ok
REVIEW
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok
ok
\ Lets add some references to the Target address ok
ok
: T@ ( a) TARGET + @ ; ok
: T! ( n a) TARGET + ! ; ok
: TC@ ( a) TARGET + C@ ; ok
: TC! ( n a) TARGET + C! ; ok
ok
\ Lets add some words to work in the target space ok
ok
VARIABLE TP ( Target Pointer) 1 TP ! ok
: THERE ( - a) TP @ ; ok
ok
2 CONSTANT TCELL ( 2 bytes per target cell) ok
ok
: TC, ( n) THERE TC! 1 TP +! ; ok
: T, ( n) THERE T! TCELL TP +! ; ok
: RENEW TARGET 32 ERASE 1 TP ! ; RENEW ok
ok
\ Lets work with our target by adding bytes ok
ok
RENEW 1 TC, 2 TC, 3 TC, REVIEW
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok

Any ideas on what I have missed?

Re: gFORTH Metal Compiler ( or attempt at building one )

<uc5roh$332pl$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24389&group=comp.lang.forth#24389

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: do-not-use@swldwa.uk (Gerry Jackson)
Newsgroups: comp.lang.forth
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
Date: Wed, 23 Aug 2023 21:55:44 +0100
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <uc5roh$332pl$1@dont-email.me>
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 23 Aug 2023 20:55:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3d569f6e82ef9a0dff4e37f55d6de5ab";
logging-data="3246901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KYDu9V9oHF9cIv7C7t1ue2eZ3k2uBhrU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:LsuYvkGbD7I50xQrUmKZyrE7mZc=
In-Reply-To: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
 by: Gerry Jackson - Wed, 23 Aug 2023 20:55 UTC

On 23/08/2023 19:20, SpainHackForth wrote:
> Hello all,
>
> I having some issue with some code I'm using to have a go at meta compilation, I'm building a 32 bit 'Target' and when I try to write some bytes into the Target which I have alloted space for, it just won't show up.
>
> Here is it is interactive in gForth:
>
> Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
> Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
> Type `bye' to exit
> CREATE TARGET 64 ALLOT ok
> TARGET 64 ERASE ok
> ok
> \ Lets add a word to examine our target: ok
> ok
> : .## ( c) 0 <# # # #> TYPE SPACE ; ok
> : REVIEW compiled
> BASE @ >R HEX \ Show target addess space. compiled
> 2 0 DO CR 32 0 DO J 32 * I + TARGET C@ .## LOOP LOOP compiled
> R> BASE ! ; ok
> ok
> ok
> REVIEW
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok

If you execute .s here you will see 0 to 63 left on the data stack.
That is left there by:
I + TARGET C@
in the inner loop of REVIEW, this should be:
I + TARGET + C@

I think it all works then.

Always test your test words like REVIEW in a simple way before using
them to test the rest of your code by putting some known data in a
simple way. erasing it and displaying 0's isn't a lot of good.

> ok
> \ Lets add some references to the Target address ok
> ok
> : T@ ( a) TARGET + @ ; ok
> : T! ( n a) TARGET + ! ; ok
> : TC@ ( a) TARGET + C@ ; ok
> : TC! ( n a) TARGET + C! ; ok
> ok
> \ Lets add some words to work in the target space ok
> ok
> VARIABLE TP ( Target Pointer) 1 TP ! ok
> : THERE ( - a) TP @ ; ok
> ok
> 2 CONSTANT TCELL ( 2 bytes per target cell) ok
> ok
> : TC, ( n) THERE TC! 1 TP +! ; ok
> : T, ( n) THERE T! TCELL TP +! ; ok
> : RENEW TARGET 32 ERASE 1 TP ! ; RENEW ok
> ok
> \ Lets work with our target by adding bytes ok
> ok
> RENEW 1 TC, 2 TC, 3 TC, REVIEW
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok
>
> Any ideas on what I have missed?

--
Gerry

Re: gFORTH Metal Compiler ( or attempt at building one )

<117864ab-ec8f-4db8-ac1f-abfaa8694279n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24390&group=comp.lang.forth#24390

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:904:b0:649:afa4:5cab with SMTP id dj4-20020a056214090400b00649afa45cabmr149969qvb.6.1692837698630;
Wed, 23 Aug 2023 17:41:38 -0700 (PDT)
X-Received: by 2002:a05:6a00:98d:b0:68b:db4f:73be with SMTP id
u13-20020a056a00098d00b0068bdb4f73bemr1433653pfg.6.1692837698315; Wed, 23 Aug
2023 17:41:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 23 Aug 2023 17:41:37 -0700 (PDT)
In-Reply-To: <uc5roh$332pl$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=162.253.131.132; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 162.253.131.132
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com> <uc5roh$332pl$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <117864ab-ec8f-4db8-ac1f-abfaa8694279n@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: brian.fox@brianfox.ca (Brian Fox)
Injection-Date: Thu, 24 Aug 2023 00:41:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 91
 by: Brian Fox - Thu, 24 Aug 2023 00:41 UTC

On Wednesday, August 23, 2023 at 4:55:48 PM UTC-4, Gerry Jackson wrote:
> On 23/08/2023 19:20, SpainHackForth wrote:
> > Hello all,
> >
> > I having some issue with some code I'm using to have a go at meta compilation, I'm building a 32 bit 'Target' and when I try to write some bytes into the Target which I have alloted space for, it just won't show up.
> >
> > Here is it is interactive in gForth:
> >
> > Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
> > Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
> > Type `bye' to exit
> > CREATE TARGET 64 ALLOT ok
> > TARGET 64 ERASE ok
> > ok
> > \ Lets add a word to examine our target: ok
> > ok
> > : .## ( c) 0 <# # # #> TYPE SPACE ; ok
> > : REVIEW compiled
> > BASE @ >R HEX \ Show target addess space. compiled
> > 2 0 DO CR 32 0 DO J 32 * I + TARGET C@ .## LOOP LOOP compiled
> > R> BASE ! ; ok
> > ok
> > ok
> > REVIEW
> > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok
>
> If you execute .s here you will see 0 to 63 left on the data stack.
> That is left there by:
> I + TARGET C@
> in the inner loop of REVIEW, this should be:
> I + TARGET + C@
>
> I think it all works then.
>
> Always test your test words like REVIEW in a simple way before using
> them to test the rest of your code by putting some known data in a
> simple way. erasing it and displaying 0's isn't a lot of good.
>
> > ok
> > \ Lets add some references to the Target address ok
> > ok
> > : T@ ( a) TARGET + @ ; ok
> > : T! ( n a) TARGET + ! ; ok
> > : TC@ ( a) TARGET + C@ ; ok
> > : TC! ( n a) TARGET + C! ; ok
> > ok
> > \ Lets add some words to work in the target space ok
> > ok
> > VARIABLE TP ( Target Pointer) 1 TP ! ok
> > : THERE ( - a) TP @ ; ok
> > ok
> > 2 CONSTANT TCELL ( 2 bytes per target cell) ok
> > ok
> > : TC, ( n) THERE TC! 1 TP +! ; ok
> > : T, ( n) THERE T! TCELL TP +! ; ok
> > : RENEW TARGET 32 ERASE 1 TP ! ; RENEW ok
> > ok
> > \ Lets work with our target by adding bytes ok
> > ok
> > RENEW 1 TC, 2 TC, 3 TC, REVIEW
> > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok
> >
> > Any ideas on what I have missed?
>
> --
> Gerry

I think it is because your target uses 2 byte cells but 32bit GForth is a 4 byte cell.
This means you need to store and fetch 2 bytes.

32 bit GForth that I have has W! and W@ for 2 bytes words.
So if you change your T! and T@ to use the W words it should help.

: T@ ( a) TARGET + W@ ;
: T! ( n a) TARGET + W! ;

It's interesting to see that you did something very similar to my own code.
Mine is simpler because I compile on a 16 bit machine to a 16 bit target.
I have thought for a while of rebuilding my cross-compiler on GForth.

Re: gFORTH Metal Compiler ( or attempt at building one )

<b6e52549-4e86-4cba-9407-2f98ea58c6f1n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24396&group=comp.lang.forth#24396

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1308:b0:40f:df11:8c07 with SMTP id v8-20020a05622a130800b0040fdf118c07mr180646qtk.1.1692873954175;
Thu, 24 Aug 2023 03:45:54 -0700 (PDT)
X-Received: by 2002:a05:6a00:13a7:b0:68a:5467:9974 with SMTP id
t39-20020a056a0013a700b0068a54679974mr5496195pfg.0.1692873953802; Thu, 24 Aug
2023 03:45:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 03:45:53 -0700 (PDT)
In-Reply-To: <117864ab-ec8f-4db8-ac1f-abfaa8694279n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=88.1.142.7; posting-account=oUnEFAoAAADoKEMDaPmswUef8xS_aFfv
NNTP-Posting-Host: 88.1.142.7
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
<uc5roh$332pl$1@dont-email.me> <117864ab-ec8f-4db8-ac1f-abfaa8694279n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b6e52549-4e86-4cba-9407-2f98ea58c6f1n@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: jemo07@gmail.com (SpainHackForth)
Injection-Date: Thu, 24 Aug 2023 10:45:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4869
 by: SpainHackForth - Thu, 24 Aug 2023 10:45 UTC

On Thursday, August 24, 2023 at 2:41:40 AM UTC+2, Brian Fox wrote:
> On Wednesday, August 23, 2023 at 4:55:48 PM UTC-4, Gerry Jackson wrote:
> > On 23/08/2023 19:20, SpainHackForth wrote:
> > > Hello all,
> > >
> > > I having some issue with some code I'm using to have a go at meta compilation, I'm building a 32 bit 'Target' and when I try to write some bytes into the Target which I have alloted space for, it just won't show up.
> > >
> > > Here is it is interactive in gForth:
> > >
> > > Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
> > > Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
> > > Type `bye' to exit
> > > CREATE TARGET 64 ALLOT ok
> > > TARGET 64 ERASE ok
> > > ok
> > > \ Lets add a word to examine our target: ok
> > > ok
> > > : .## ( c) 0 <# # # #> TYPE SPACE ; ok
> > > : REVIEW compiled
> > > BASE @ >R HEX \ Show target addess space. compiled
> > > 2 0 DO CR 32 0 DO J 32 * I + TARGET C@ .## LOOP LOOP compiled
> > > R> BASE ! ; ok
> > > ok
> > > ok
> > > REVIEW
> > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok
> >
> > If you execute .s here you will see 0 to 63 left on the data stack.
> > That is left there by:
> > I + TARGET C@
> > in the inner loop of REVIEW, this should be:
> > I + TARGET + C@
> >
> > I think it all works then.
> >
> > Always test your test words like REVIEW in a simple way before using
> > them to test the rest of your code by putting some known data in a
> > simple way. erasing it and displaying 0's isn't a lot of good.
> >
> > > ok
> > > \ Lets add some references to the Target address ok
> > > ok
> > > : T@ ( a) TARGET + @ ; ok
> > > : T! ( n a) TARGET + ! ; ok
> > > : TC@ ( a) TARGET + C@ ; ok
> > > : TC! ( n a) TARGET + C! ; ok
> > > ok
> > > \ Lets add some words to work in the target space ok
> > > ok
> > > VARIABLE TP ( Target Pointer) 1 TP ! ok
> > > : THERE ( - a) TP @ ; ok
> > > ok
> > > 2 CONSTANT TCELL ( 2 bytes per target cell) ok
> > > ok
> > > : TC, ( n) THERE TC! 1 TP +! ; ok
> > > : T, ( n) THERE T! TCELL TP +! ; ok
> > > : RENEW TARGET 32 ERASE 1 TP ! ; RENEW ok
> > > ok
> > > \ Lets work with our target by adding bytes ok
> > > ok
> > > RENEW 1 TC, 2 TC, 3 TC, REVIEW
> > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ok
> > >
> > > Any ideas on what I have missed?
> >
> > --
> > Gerry
> I think it is because your target uses 2 byte cells but 32bit GForth is a 4 byte cell.
> This means you need to store and fetch 2 bytes.
>
> 32 bit GForth that I have has W! and W@ for 2 bytes words.
> So if you change your T! and T@ to use the W words it should help.
>
> : T@ ( a) TARGET + W@ ;
> : T! ( n a) TARGET + W! ;
>
> It's interesting to see that you did something very similar to my own code.
> Mine is simpler because I compile on a 16 bit machine to a 16 bit target.
> I have thought for a while of rebuilding my cross-compiler on GForth.
Ah, OK let me try that!
Thank you.

Re: gFORTH Metal Compiler ( or attempt at building one )

<a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24397&group=comp.lang.forth#24397

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:4ba2:0:b0:635:e5ff:b4b7 with SMTP id i2-20020ad44ba2000000b00635e5ffb4b7mr198236qvw.3.1692874130275;
Thu, 24 Aug 2023 03:48:50 -0700 (PDT)
X-Received: by 2002:a17:903:11c8:b0:1bc:6f8c:7c15 with SMTP id
q8-20020a17090311c800b001bc6f8c7c15mr6793228plh.7.1692874129682; Thu, 24 Aug
2023 03:48:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 03:48:48 -0700 (PDT)
In-Reply-To: <uc5roh$332pl$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=88.1.142.7; posting-account=oUnEFAoAAADoKEMDaPmswUef8xS_aFfv
NNTP-Posting-Host: 88.1.142.7
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com> <uc5roh$332pl$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: jemo07@gmail.com (SpainHackForth)
Injection-Date: Thu, 24 Aug 2023 10:48:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1780
 by: SpainHackForth - Thu, 24 Aug 2023 10:48 UTC

On Wednesday, August 23, 2023 at 10:55:48 PM UTC+2, Gerry Jackson wrote:

> If you execute .s here you will see 0 to 63 left on the data stack.
> That is left there by:
> I + TARGET C@
> in the inner loop of REVIEW, this should be:
> I + TARGET + C@
>
> I think it all works then.
>
> Always test your test words like REVIEW in a simple way before using
> them to test the rest of your code by putting some known data in a
> simple way. erasing it and displaying 0's isn't a lot of good.

> Gerry
THANK YOU!!! Let me try that...

Re: gFORTH Metal Compiler ( or attempt at building one )

<8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24398&group=comp.lang.forth#24398

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1ba3:b0:403:e8a7:bd9b with SMTP id bp35-20020a05622a1ba300b00403e8a7bd9bmr175819qtb.11.1692875233150;
Thu, 24 Aug 2023 04:07:13 -0700 (PDT)
X-Received: by 2002:a63:8f09:0:b0:566:2d6:f71b with SMTP id
n9-20020a638f09000000b0056602d6f71bmr2943008pgd.12.1692875232834; Thu, 24 Aug
2023 04:07:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 04:07:12 -0700 (PDT)
In-Reply-To: <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=88.1.142.7; posting-account=oUnEFAoAAADoKEMDaPmswUef8xS_aFfv
NNTP-Posting-Host: 88.1.142.7
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
<uc5roh$332pl$1@dont-email.me> <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: jemo07@gmail.com (SpainHackForth)
Injection-Date: Thu, 24 Aug 2023 11:07:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3143
 by: SpainHackForth - Thu, 24 Aug 2023 11:07 UTC

On Thursday, August 24, 2023 at 12:48:51 PM UTC+2, SpainHackForth wrote:
> On Wednesday, August 23, 2023 at 10:55:48 PM UTC+2, Gerry Jackson wrote:
>
>
> > If you execute .s here you will see 0 to 63 left on the data stack.
> > That is left there by:
> > I + TARGET C@
> > in the inner loop of REVIEW, this should be:
> > I + TARGET + C@
> >
> > I think it all works then.
> >
> > Always test your test words like REVIEW in a simple way before using
> > them to test the rest of your code by putting some known data in a
> > simple way. erasing it and displaying 0's isn't a lot of good.
> > Gerry
> THANK YOU!!! Let me try that...
Ah, I now see where I changed my code and must have just removed the + sign there Garry, THANK YOU for capturing that... I went down a deeeeeep rat whole looking from something in how I was writing TC,

Bryan, any benefit in using W@ vs @, I'm looking at how I build some meta-compilation for 32 bit ARMv8 so I was looking it at a byte level, I have most of the code in place, just getting some inconsistencies in building my headers, then I'm exploring how to get some of the variable folding in place.... that is a deeper rat whole at the moment...

Thank you both... I did create a simpler version of the REVIEW word just to check if I was doing something wrong in storing:

: REVIEW
BASE @ >R HEX ( Show target addess space.)
TARGET 32 0 DO ( loop 32 times )
DUP C@ .## ( fetch byte from address, display it, then push the address back )
1+ ( increment the address to point to the next byte )
LOOP
DROP ( drop the remaining address )
R> BASE ! ( Return address space. )
;

Cheers!

Re: gFORTH Metal Compiler ( or attempt at building one )

<de4a3f04-07d6-42a9-ac89-8132556c3ba2n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24401&group=comp.lang.forth#24401

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:8acb:b0:76d:a021:5cb8 with SMTP id qv11-20020a05620a8acb00b0076da0215cb8mr144247qkn.11.1692880072238;
Thu, 24 Aug 2023 05:27:52 -0700 (PDT)
X-Received: by 2002:a63:7046:0:b0:565:dc04:c915 with SMTP id
a6-20020a637046000000b00565dc04c915mr2885904pgn.9.1692880071727; Thu, 24 Aug
2023 05:27:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 05:27:51 -0700 (PDT)
In-Reply-To: <8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=88.1.142.7; posting-account=oUnEFAoAAADoKEMDaPmswUef8xS_aFfv
NNTP-Posting-Host: 88.1.142.7
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
<uc5roh$332pl$1@dont-email.me> <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
<8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <de4a3f04-07d6-42a9-ac89-8132556c3ba2n@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: jemo07@gmail.com (SpainHackForth)
Injection-Date: Thu, 24 Aug 2023 12:27:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3334
 by: SpainHackForth - Thu, 24 Aug 2023 12:27 UTC

On Thursday, August 24, 2023 at 1:07:14 PM UTC+2, SpainHackForth wrote:
> On Thursday, August 24, 2023 at 12:48:51 PM UTC+2, SpainHackForth wrote:
> > On Wednesday, August 23, 2023 at 10:55:48 PM UTC+2, Gerry Jackson wrote:
> >
> >
> > > If you execute .s here you will see 0 to 63 left on the data stack.
> > > That is left there by:
> > > I + TARGET C@
> > > in the inner loop of REVIEW, this should be:
> > > I + TARGET + C@
> > >
> > > I think it all works then.
> > >
> > > Always test your test words like REVIEW in a simple way before using
> > > them to test the rest of your code by putting some known data in a
> > > simple way. erasing it and displaying 0's isn't a lot of good.
> > > Gerry
> > THANK YOU!!! Let me try that...
> Ah, I now see where I changed my code and must have just removed the + sign there Garry, THANK YOU for capturing that... I went down a deeeeeep rat whole looking from something in how I was writing TC,
>
> Bryan, any benefit in using W@ vs @, I'm looking at how I build some meta-compilation for 32 bit ARMv8 so I was looking it at a byte level, I have most of the code in place, just getting some inconsistencies in building my headers, then I'm exploring how to get some of the variable folding in place... that is a deeper rat whole at the moment...
>
>
> Thank you both... I did create a simpler version of the REVIEW word just to check if I was doing something wrong in storing:
>
> : REVIEW
> BASE @ >R HEX ( Show target addess space.)
> TARGET 32 0 DO ( loop 32 times )
> DUP C@ .## ( fetch byte from address, display it, then push the address back )
> 1+ ( increment the address to point to the next byte )
> LOOP
> DROP ( drop the remaining address )
> R> BASE ! ( Return address space. )
> ;
>
> Cheers!
* Variable Folding should be constant folding...

Re: gFORTH Metal Compiler ( or attempt at building one )

<35927e78-f31b-4001-86f0-012032f56b03n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24409&group=comp.lang.forth#24409

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:55cc:0:b0:641:8a6a:328e with SMTP id bt12-20020ad455cc000000b006418a6a328emr182206qvb.8.1692887818640;
Thu, 24 Aug 2023 07:36:58 -0700 (PDT)
X-Received: by 2002:a05:6a00:181f:b0:68a:4183:4379 with SMTP id
y31-20020a056a00181f00b0068a41834379mr6139207pfa.2.1692887818043; Thu, 24 Aug
2023 07:36:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 07:36:57 -0700 (PDT)
In-Reply-To: <8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=99.242.210.36; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 99.242.210.36
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
<uc5roh$332pl$1@dont-email.me> <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
<8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <35927e78-f31b-4001-86f0-012032f56b03n@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: brian.fox@brianfox.ca (Brian Fox)
Injection-Date: Thu, 24 Aug 2023 14:36:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3309
 by: Brian Fox - Thu, 24 Aug 2023 14:36 UTC

On Thursday, August 24, 2023 at 7:07:14 AM UTC-4, SpainHackForth wrote:
> On Thursday, August 24, 2023 at 12:48:51 PM UTC+2, SpainHackForth wrote:

> Bryan, any benefit in using W@ vs @, I'm looking at how I build some meta-compilation for 32 bit ARMv8 so I was looking it at a byte level, I have most of the code in place, just getting some inconsistencies in building my headers, then I'm exploring how to get some of the variable folding in place... that is a deeper rat whole at the moment...

I don't know the ARMv8 instruction set details but if there are cases where the instruction fits into 16bits then
you can use W!.
Of course you could make your own version using shifts and OR and two C! words but W! is there to use.

BTW Here is how I did it for a machine with fixed size instructions of 16 bits.
I just replicated the way the Forth dictionary works with a T prefix on the word names.
It keeps my human memory load manageable.

\ target memory management
VARIABLE TDP \ target dictionary pointer

\ set where the Cross-assembler puts its code
HEX
: ORG ( addr -- ) TDP ! ;

: NEW 2000 2000 FF FILL 1FFF H ! ; \ H is the HEAP pointer in this system.

\ Target versions of HERE and ALLOT
: THERE ( -- addr) TDP @ ;
: TALLOT ( n -- ) TDP +! ;

\ integer and byte "Target" compilers
: T, ( n -- ) THERE ! 1 CELLS TALLOT ;
: TC, ( c -- ) THERE C! 1 TALLOT ;

Later in the cross-compiler I needed to deal with relocation.
The case is:
- the image compiled in a buffer on the machine.
- The programmer wants the program to load and run at a different address.

It might be more confusing, but if it helps the source code for this Machine Forth
is here:

https://github.com/bfox9900/MachForth/tree/main/COMPILER/src

Search for REL>TARG to see what I did for relocation and where it was used..

Re: gFORTH Metal Compiler ( or attempt at building one )

<e934161b-46bd-455c-a7ef-ee286de860abn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24414&group=comp.lang.forth#24414

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:59d4:0:b0:410:a05c:69bb with SMTP id f20-20020ac859d4000000b00410a05c69bbmr186704qtf.4.1692891207075;
Thu, 24 Aug 2023 08:33:27 -0700 (PDT)
X-Received: by 2002:a05:6a00:2309:b0:68a:61fb:801c with SMTP id
h9-20020a056a00230900b0068a61fb801cmr4472848pfh.4.1692891206765; Thu, 24 Aug
2023 08:33:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 08:33:26 -0700 (PDT)
In-Reply-To: <35927e78-f31b-4001-86f0-012032f56b03n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=88.1.142.7; posting-account=oUnEFAoAAADoKEMDaPmswUef8xS_aFfv
NNTP-Posting-Host: 88.1.142.7
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
<uc5roh$332pl$1@dont-email.me> <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
<8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com> <35927e78-f31b-4001-86f0-012032f56b03n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e934161b-46bd-455c-a7ef-ee286de860abn@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: jemo07@gmail.com (SpainHackForth)
Injection-Date: Thu, 24 Aug 2023 15:33:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3685
 by: SpainHackForth - Thu, 24 Aug 2023 15:33 UTC

On Thursday, August 24, 2023 at 4:37:00 PM UTC+2, Brian Fox wrote:
> On Thursday, August 24, 2023 at 7:07:14 AM UTC-4, SpainHackForth wrote:
> > On Thursday, August 24, 2023 at 12:48:51 PM UTC+2, SpainHackForth wrote:
>
> > Bryan, any benefit in using W@ vs @, I'm looking at how I build some meta-compilation for 32 bit ARMv8 so I was looking it at a byte level, I have most of the code in place, just getting some inconsistencies in building my headers, then I'm exploring how to get some of the variable folding in place... that is a deeper rat whole at the moment...
> I don't know the ARMv8 instruction set details but if there are cases where the instruction fits into 16bits then
> you can use W!.
> Of course you could make your own version using shifts and OR and two C! words but W! is there to use.
>
> BTW Here is how I did it for a machine with fixed size instructions of 16 bits.
> I just replicated the way the Forth dictionary works with a T prefix on the word names.
> It keeps my human memory load manageable.
>
> \ target memory management
> VARIABLE TDP \ target dictionary pointer
>
> \ set where the Cross-assembler puts its code
> HEX
> : ORG ( addr -- ) TDP ! ;
>
> : NEW 2000 2000 FF FILL 1FFF H ! ; \ H is the HEAP pointer in this system..
>
> \ Target versions of HERE and ALLOT
> : THERE ( -- addr) TDP @ ;
> : TALLOT ( n -- ) TDP +! ;
>
> \ integer and byte "Target" compilers
> : T, ( n -- ) THERE ! 1 CELLS TALLOT ;
> : TC, ( c -- ) THERE C! 1 TALLOT ;
>
> Later in the cross-compiler I needed to deal with relocation.
> The case is:
> - the image compiled in a buffer on the machine.
> - The programmer wants the program to load and run at a different address..
>
> It might be more confusing, but if it helps the source code for this Machine Forth
> is here:
>
> https://github.com/bfox9900/MachForth/tree/main/COMPILER/src
>
> Search for REL>TARG to see what I did for relocation and where it was used.
Awesome, THANK YOU !!! I'll have a look! Ah, relocation might be an issue latter on, I believe that might pop up when I get it running.

Re: gFORTH Metal Compiler ( or attempt at building one )

<8b7a6376-f3cb-48c1-a41e-c23bb4e0799dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24425&group=comp.lang.forth#24425

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:fec4:0:b0:635:e9f6:9470 with SMTP id z4-20020a0cfec4000000b00635e9f69470mr296517qvs.5.1692910116377;
Thu, 24 Aug 2023 13:48:36 -0700 (PDT)
X-Received: by 2002:a05:620a:40f:b0:76d:7a99:9b33 with SMTP id
15-20020a05620a040f00b0076d7a999b33mr236816qkp.1.1692910116043; Thu, 24 Aug
2023 13:48:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 13:48:35 -0700 (PDT)
In-Reply-To: <35927e78-f31b-4001-86f0-012032f56b03n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=88.1.142.7; posting-account=oUnEFAoAAADoKEMDaPmswUef8xS_aFfv
NNTP-Posting-Host: 88.1.142.7
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
<uc5roh$332pl$1@dont-email.me> <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
<8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com> <35927e78-f31b-4001-86f0-012032f56b03n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8b7a6376-f3cb-48c1-a41e-c23bb4e0799dn@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: jemo07@gmail.com (SpainHackForth)
Injection-Date: Thu, 24 Aug 2023 20:48:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4132
 by: SpainHackForth - Thu, 24 Aug 2023 20:48 UTC

On Thursday, August 24, 2023 at 4:37:00 PM UTC+2, Brian Fox wrote:
> On Thursday, August 24, 2023 at 7:07:14 AM UTC-4, SpainHackForth wrote:
> > On Thursday, August 24, 2023 at 12:48:51 PM UTC+2, SpainHackForth wrote:
>
> > Bryan, any benefit in using W@ vs @, I'm looking at how I build some meta-compilation for 32 bit ARMv8 so I was looking it at a byte level, I have most of the code in place, just getting some inconsistencies in building my headers, then I'm exploring how to get some of the variable folding in place... that is a deeper rat whole at the moment...
> I don't know the ARMv8 instruction set details but if there are cases where the instruction fits into 16bits then
> you can use W!.
> Of course you could make your own version using shifts and OR and two C! words but W! is there to use.
>
> BTW Here is how I did it for a machine with fixed size instructions of 16 bits.
> I just replicated the way the Forth dictionary works with a T prefix on the word names.
> It keeps my human memory load manageable.
>
> \ target memory management
> VARIABLE TDP \ target dictionary pointer
>
> \ set where the Cross-assembler puts its code
> HEX
> : ORG ( addr -- ) TDP ! ;
>
> : NEW 2000 2000 FF FILL 1FFF H ! ; \ H is the HEAP pointer in this system..
>
> \ Target versions of HERE and ALLOT
> : THERE ( -- addr) TDP @ ;
> : TALLOT ( n -- ) TDP +! ;
>
> \ integer and byte "Target" compilers
> : T, ( n -- ) THERE ! 1 CELLS TALLOT ;
> : TC, ( c -- ) THERE C! 1 TALLOT ;
>
> Later in the cross-compiler I needed to deal with relocation.
> The case is:
> - the image compiled in a buffer on the machine.
> - The programmer wants the program to load and run at a different address..
>
> It might be more confusing, but if it helps the source code for this Machine Forth
> is here:
>
> https://github.com/bfox9900/MachForth/tree/main/COMPILER/src
>
> Search for REL>TARG to see what I did for relocation and where it was used.
Just took a peek, and that is some clean code! thank you again for sharing this! I see some resemblance in the structure, very readable and well constrained in the sections and how you build the code up. I did not look to much into the code "yet" but I think I saw how you build the different opcodes based on their conditional formats, or at least that is how I'm setting up the code I'm working on, they are structured differently.

Here is the sheet I work with to see all the opcodes:
https://montcs.bloomu.edu/Information/ARMv8/legv8-green-card.compressed.pdf

Re: gFORTH Metal Compiler ( or attempt at building one )

<05eef232-b46c-4d4a-a323-15d88d7bcb5fn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24426&group=comp.lang.forth#24426

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:551d:0:b0:63c:fe6e:bb4 with SMTP id pz29-20020ad4551d000000b0063cfe6e0bb4mr270531qvb.0.1692920130931;
Thu, 24 Aug 2023 16:35:30 -0700 (PDT)
X-Received: by 2002:a05:620a:8508:b0:76c:8fe1:604 with SMTP id
pe8-20020a05620a850800b0076c8fe10604mr234226qkn.13.1692920130708; Thu, 24 Aug
2023 16:35:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 24 Aug 2023 16:35:30 -0700 (PDT)
In-Reply-To: <8b7a6376-f3cb-48c1-a41e-c23bb4e0799dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=162.253.129.102; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 162.253.129.102
References: <194a5746-d381-4386-8af2-f4c236e26243n@googlegroups.com>
<uc5roh$332pl$1@dont-email.me> <a53c6411-1b7d-42f2-8ed6-b31162e314e2n@googlegroups.com>
<8c2d41cb-48d2-4219-8958-561d7e2cc364n@googlegroups.com> <35927e78-f31b-4001-86f0-012032f56b03n@googlegroups.com>
<8b7a6376-f3cb-48c1-a41e-c23bb4e0799dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <05eef232-b46c-4d4a-a323-15d88d7bcb5fn@googlegroups.com>
Subject: Re: gFORTH Metal Compiler ( or attempt at building one )
From: brian.fox@brianfox.ca (Brian Fox)
Injection-Date: Thu, 24 Aug 2023 23:35:30 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Brian Fox - Thu, 24 Aug 2023 23:35 UTC

On Thursday, August 24, 2023 at 4:48:38 PM UTC-4, SpainHackForth wrote:
> On Thursday, August 24, 2023 at 4:37:00 PM UTC+2, Brian Fox wrote:
> > On Thursday, August 24, 2023 at 7:07:14 AM UTC-4, SpainHackForth wrote:
> > > On Thursday, August 24, 2023 at 12:48:51 PM UTC+2, SpainHackForth wrote:
> >
> > > Bryan, any benefit in using W@ vs @, I'm looking at how I build some meta-compilation for 32 bit ARMv8 so I was looking it at a byte level, I have most of the code in place, just getting some inconsistencies in building my headers, then I'm exploring how to get some of the variable folding in place... that is a deeper rat whole at the moment...
> > I don't know the ARMv8 instruction set details but if there are cases where the instruction fits into 16bits then
> > you can use W!.
> > Of course you could make your own version using shifts and OR and two C! words but W! is there to use.
> >
> > BTW Here is how I did it for a machine with fixed size instructions of 16 bits.
> > I just replicated the way the Forth dictionary works with a T prefix on the word names.
> > It keeps my human memory load manageable.
> >
> > \ target memory management
> > VARIABLE TDP \ target dictionary pointer
> >
> > \ set where the Cross-assembler puts its code
> > HEX
> > : ORG ( addr -- ) TDP ! ;
> >
> > : NEW 2000 2000 FF FILL 1FFF H ! ; \ H is the HEAP pointer in this system.
> >
> > \ Target versions of HERE and ALLOT
> > : THERE ( -- addr) TDP @ ;
> > : TALLOT ( n -- ) TDP +! ;
> >
> > \ integer and byte "Target" compilers
> > : T, ( n -- ) THERE ! 1 CELLS TALLOT ;
> > : TC, ( c -- ) THERE C! 1 TALLOT ;
> >
> > Later in the cross-compiler I needed to deal with relocation.
> > The case is:
> > - the image compiled in a buffer on the machine.
> > - The programmer wants the program to load and run at a different address.
> >
> > It might be more confusing, but if it helps the source code for this Machine Forth
> > is here:
> >
> > https://github.com/bfox9900/MachForth/tree/main/COMPILER/src
> >
> > Search for REL>TARG to see what I did for relocation and where it was used.
> Just took a peek, and that is some clean code! thank you again for sharing this! I see some resemblance in the structure, very readable and well constrained in the sections and how you build the code up. I did not look to much into the code "yet" but I think I saw how you build the different opcodes based on their conditional formats, or at least that is how I'm setting up the code I'm working on, they are structured differently.
>
> Here is the sheet I work with to see all the opcodes:
> https://montcs.bloomu.edu/Information/ARMv8/legv8-green-card.compressed.pdf

I am happy it provided some insights.
I started with the Assembler and worked up from there.
I also must admit that I got a helping hand from some TI engineers from 40 years ago
who wrote an assembler for this machine in Forth.
I did a lot of mods but it gave me the bones and the 9900 simpler than ARM.

Makes me wonder if there is an open-source Forth Assembler for ARM that you could
modify? Or maybe you prefer complete DIY. ??

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor