Dear all,
As a hobby project, I am designing a 32-bit processor which I am
simulating using Common Lisp (mostly based upon SIMH ideas). Currently
I have a working simulation of a simple load/store instruction set, an
assembler and some simple test programs.
However, I want to go further. Last fall I implemented a simple Lisp
interpreter in Perl and now I want to implement a simple Lisp
interpreter on my simulated machine. However, I would like to
start with a Lisp description of all my necessary code and in order to
do that I would like to know if there are somewhere examples and
implementations of (Common) Lisp/Scheme code which
deal with structures in the C sense of the word (contiguous blocks of
memory with fields which are just offsets in the block) ?
Regards,
Jurgen
|
|
0
|
|
|
|
Reply
|
jurgen.defurne1 (118)
|
6/4/2009 12:38:49 PM |
|
On Jun 4, 2:38=A0pm, jurgen_defurne <jurgen.defu...@pandora.be> wrote:
> Dear all,
>
> As a hobby project, I am designing a 32-bit processor which I am
> simulating using Common Lisp (mostly based upon SIMH ideas). Currently
> I have a working simulation of a simple load/store instruction set, an
> assembler and some simple test programs.
>
> However, I want to go further. Last fall I implemented a simple Lisp
> interpreter in Perl and now I want to implement a simple Lisp
> interpreter on my simulated machine. However, I would like to
> start with a Lisp description of all my necessary code and in order to
> do that I would like to know if there are somewhere examples and
> implementations of (Common) Lisp/Scheme code which
> deal with structures in the C sense of the word (contiguous blocks of
> memory with fields which are just offsets in the block) ?
>
> Regards,
>
> Jurgen
You can take a look at Movitz: http://common-lisp.net/project/movitz/
It is a Common Lisp implementation targeting bare x86 processors.
hth,
Alessio
|
|
0
|
|
|
|
Reply
|
alessiostalla (364)
|
6/4/2009 12:53:09 PM
|
|
On Jun 4, 2:53=A0pm, Alessio Stalla <alessiosta...@gmail.com> wrote:
> On Jun 4, 2:38=A0pm, jurgen_defurne <jurgen.defu...@pandora.be> wrote:
>
>
>
> > Dear all,
>
> > As a hobby project, I am designing a 32-bit processor which I am
> > simulating using Common Lisp (mostly based upon SIMH ideas). Currently
> > I have a working simulation of a simple load/store instruction set, an
> > assembler and some simple test programs.
>
> > However, I want to go further. Last fall I implemented a simple Lisp
> > interpreter in Perl and now I want to implement a simple Lisp
> > interpreter on my simulated machine. However, I would like to
> > start with a Lisp description of all my necessary code and in order to
> > do that I would like to know if there are somewhere examples and
> > implementations of (Common) Lisp/Scheme code which
> > deal with structures in the C sense of the word (contiguous blocks of
> > memory with fields which are just offsets in the block) ?
>
> > Regards,
>
> > Jurgen
>
> You can take a look at Movitz:http://common-lisp.net/project/movitz/
> It is a Common Lisp implementation targeting bare x86 processors.
>
> hth,
> Alessio
Silly me, I knew about Movitz, but forgot about it.
Thanks.
|
|
0
|
|
|
|
Reply
|
jurgen.defurne1 (118)
|
6/4/2009 12:56:31 PM
|
|
jurgen_defurne <jurgen.defurne@pandora.be> wrote:
+---------------
| As a hobby project, I am designing a 32-bit processor which I am
| simulating using Common Lisp (mostly based upon SIMH ideas). Currently
| I have a working simulation of a simple load/store instruction set, an
| assembler and some simple test programs.
+---------------
Neat!
+---------------
| However, I want to go further. Last fall I implemented a simple Lisp
| interpreter in Perl and now I want to implement a simple Lisp
| interpreter on my simulated machine. However, I would like to
| start with a Lisp description of all my necessary code and in order to
| do that I would like to know if there are somewhere examples and
| implementations of (Common) Lisp/Scheme code which
| deal with structures in the C sense of the word (contiguous blocks of
| memory with fields which are just offsets in the block) ?
+---------------
Please say a little more about exactly what you mean by "deal with
structures". Almost all Lisp/Scheme compilers/interpreters have some
sort of simple "deref+offset" operators down at the bottom of their
implementations. E.g., DEFSTRUCT accessors might be defined as closures
over a more primitive operator such as (an internal version of) ELT,
perhaps.
Also, in terms of generating code for a "raw" machine, make sure you've
read the chapters on compilation in both SICP <http://mitpress.mit.edu/sicp/>
and L.i.S.P. <http://www-spi.lip6.fr/~queinnec/WWW/LiSP.html> [and maybe
even the bits on compiling in PAIP <http://www.norvig.com/paip.html>].
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
|
|
0
|
|
|
|
Reply
|
rpw3 (2294)
|
6/5/2009 2:13:33 AM
|
|
On Jun 5, 4:13=A0am, r...@rpw3.org (Rob Warnock) wrote:
> Please say a little more about exactly what you mean by "deal with
> structures". Almost all Lisp/Scheme compilers/interpreters have some
> sort of simple "deref+offset" operators down at the bottom of their
> implementations. E.g., DEFSTRUCT accessors might be defined as closures
> over a more primitive operator such as (an internal version of) ELT,
> perhaps.
Basically, this is it what you say, 'deref+offset', since every
programming language needs to be able to access its most basic
datastructure. Writing a primitive version of ELT is maybe enough to
start, plus something to access bit fields. You know, I am currently
just trying to get an orientation on things to do.
> Also, in terms of generating code for a "raw" machine, make sure you've
> read the chapters on compilation in both SICP <http://mitpress.mit.edu/si=
cp/>
> and L.i.S.P. <http://www-spi.lip6.fr/~queinnec/WWW/LiSP.html> [and maybe
> even the bits on compiling in PAIP <http://www.norvig.com/paip.html>].
These parts are in the future on my reading list. I have both SICP and
PiSL (the latest French version of LiSP) at home.
Regards,
Jurgen
|
|
0
|
|
|
|
Reply
|
jurgen.defurne1 (118)
|
6/5/2009 6:50:28 AM
|
|
On 5 Jun., 08:50, chthon <jurgen.defu...@pandora.be> wrote:
> On Jun 5, 4:13=A0am, r...@rpw3.org (Rob Warnock) wrote:
>
> > Please say a little more about exactly what you mean by "deal with
> > structures". Almost all Lisp/Scheme compilers/interpreters have some
> > sort of simple "deref+offset" operators down at the bottom of their
> > implementations. E.g., DEFSTRUCT accessors might be defined as closures
> > over a more primitive operator such as (an internal version of) ELT,
> > perhaps.
>
> Basically, this is it what you say, 'deref+offset', since every
> programming language needs to be able to access its most basic
> datastructure. Writing a primitive version of ELT is maybe enough to
> start, plus something to access bit fields. You know, I am currently
> just trying to get an orientation on things to do.
>
> > Also, in terms of generating code for a "raw" machine, make sure you've
> > read the chapters on compilation in both SICP <http://mitpress.mit.edu/=
sicp/>
> > and L.i.S.P. <http://www-spi.lip6.fr/~queinnec/WWW/LiSP.html> [and mayb=
e
> > even the bits on compiling in PAIP <http://www.norvig.com/paip.html>].
>
> These parts are in the future on my reading list. I have both SICP and
> PiSL (the latest French version of LiSP) at home.
>
> Regards,
>
> Jurgen
For example:
http://ccl.clozure.com/ccl-documentation.html#Referencing-and-Using-Foreign=
-Memory-Addresses
http://ccl.clozure.com/ccl-documentation.html#id415320
|
|
0
|
|
|
|
Reply
|
joswig8642 (2198)
|
6/5/2009 7:38:28 AM
|
|
|
5 Replies
33 Views
(page loaded in 0.707 seconds)
Similiar Articles: input & output in assembly - comp.lang.asm.x86... OS or assembler, then the following example code is ... systems for V86 mode) than the Win32 interface. Now to your example ... iron and oscillascope against the bare metal of ... Common Lisp « On Scheme... are directed primarily at Common Lisp, Scheme is ... use an older compiler for the code, for example ... if dialects are lisp-1 or lisp-2, and the C foreign function interface (to ... Common Lisp, Clojure, and seriousness. | Three of Coins... top to bare metal ... code in clojure or jruby or whatnot). More importantly it’s not even common lisp specific ... one-page example. The basic idea is “Let’s create a Lisp ... 7/25/2012 11:48:00 PM
|