Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #19560
| From | Spam@ControlQ.com |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: RAFTS-like compiler; some progress |
| Date | 2013-02-08 16:16 -0500 |
| Organization | albasani.net |
| Message-ID | <alpine.BSF.2.00.1302081607220.99043@yoko.controlq.com> (permalink) |
| References | <06473a40-9b01-4325-b840-d6e8062e546b@e11g2000vbv.googlegroups.com> |
On Wed, 6 Feb 2013, Alex McDonald wrote: > Date: Wed, 6 Feb 2013 15:55:13 -0800 (PST) > From: Alex McDonald <blog@rivadpm.com> > Newsgroups: comp.lang.forth > Subject: RAFTS-like compiler; some progress > > I've made a small amount of progress with the analytic compiler. > Here's the IL with hand edited comments; > > > : testif 1 2 if 3 4 if 5 then then 6 ; > > block ( S: 0 -- 1 R: 0 -- 0 ) \ stack is 0 in, and 1 out > $2A40020 (1) block-begin > $2A40044 (1) [5] literal $1 \ [5] represents register 5 > $2A40068 (1) [4] literal $2 \ (n) represents the use > count > $2A4008C (1) sput [5] S[-1] \ puts reg 5 on the stack > $2A400B0 (1) sptr+ -1 \ adjust stack > $2A400D4 (1) bra-z [4] --> $2A40314 > $2A400F8 (1) block-end > $2A4011C (1) block-begin > $2A40140 (1) [3] literal $3 > $2A40164 (1) [2] literal $4 > $2A40188 (1) sput [3] S[-1] > $2A401AC (1) sptr+ -1 > $2A401D0 (1) bra-z [2] --> $2A402CC > $2A401F4 (1) block-end > $2A40218 (1) block-begin > $2A4023C (1) [1] literal $5 > $2A40260 (1) sput [1] S[-1] > $2A40284 (1) sptr+ -1 > $2A402A8 (1) block-end > $2A402CC (1) block-begin \ empty; nothing between > "then then" > $2A402F0 (1) block-end > $2A40314 (1) block-begin > $2A40338 (1) [6] literal $6 > $2A4035C (1) sput [6] S[-1] > $2A40380 (1) sptr+ -1 > $2A403A4 (1) block-end > > > Progress, since the prior version didn't support conditionals. The > burg is also making (very slow) progress. > Alex, I'm not entirely sure I understand what a RAFTS-like compiler is. Do you have pointers/references?? Is this a virtual assembler language? My miniforth interpreter generates the following for your testif word, and the stack is shown below ... I guess I'm trying to find the point of your exercise, and where you're heading with this ... seems intriguing 8-). Cheers, Rob. -- MiniForth-Hosted alpha Version: 00.01.16D -- www.ControlQ.com ok : testif 1 2 if 3 4 if 5 then then 6 ; ok ' testif see -- testif (627A60) word flg: 0. 607A60 (literal) = 1 607A70 (literal) = 2 607A80 ?branch -> 607AD0 607A90 (literal) = 3 607AA0 (literal) = 4 607AB0 ?branch -> 607AD0 607AC0 (literal) = 5 607AD0 (literal) = 6 607AE0 next ok testif .s 4 : 1 3 5 6 ok
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
RAFTS-like compiler; some progress Alex McDonald <blog@rivadpm.com> - 2013-02-06 15:55 -0800
Re: RAFTS-like compiler; some progress Spam@ControlQ.com - 2013-02-08 16:16 -0500
Re: RAFTS-like compiler; some progress Alex McDonald <blog@rivadpm.com> - 2013-02-08 14:40 -0800
Re: RAFTS-like compiler; some progress mhx@iae.nl (Marcel Hendrix) - 2013-02-09 10:37 +0200
Re: RAFTS-like compiler; some progress Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2013-02-09 12:06 +0100
Re: RAFTS-like compiler; some progress albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-02-09 15:46 +0000
Re: RAFTS-like compiler; some progress anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-09 14:38 +0000
Re: RAFTS-like compiler; some progress Brad Eckert <hwfwguy@gmail.com> - 2013-02-11 08:57 -0800
Re: RAFTS-like compiler; some progress anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-11 17:39 +0000
Re: RAFTS-like compiler; some progress Brad Eckert <hwfwguy@gmail.com> - 2013-02-11 10:48 -0800
Re: RAFTS-like compiler; some progress Alex McDonald <blog@rivadpm.com> - 2013-02-11 18:56 -0800
Re: RAFTS-like compiler; some progress Alex McDonald <blog@rivadpm.com> - 2013-02-11 18:58 -0800
Re: RAFTS-like compiler; some progress anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-14 12:55 +0000
Re: RAFTS-like compiler; some progress anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-09 14:44 +0000
Re: RAFTS-like compiler; some progress Alex McDonald <blog@rivadpm.com> - 2013-02-11 19:09 -0800
csiph-web