Hi
I can't recall exactly but I had a NC4000 CPU with less than 4K words in ROM and
about 1K words for the compiler that could completely recompile it self in about
17 seconds ( including compiling the compiler-compiler ).
The NC4000 was running a 4MHz with a old XT HD controller and a 5 Meg
hard disk.
Of course, it was an optimized Forth processor and could run two memory
busses at the same time.
It used a variant of Forth call CMFORTH. It was vary simple and had no
states like many Forths. It had two interperters, one for interactive and
one to compile.
While a Forth interpreter could be completely written in assembly, I've
not seen it done. It is quite trivial and can only really benifit from an assembly
language dictionary search as the rest has vary little overhead.
Such and interpreter would look like:
Parse out a word from the input stream
See if it is in the dictionary
If so execute it
If not see if it is a number
If so put it on the stack
else report error and stop
Repeat.
You'll note that there is no funny business about checking to
see what comes first, just do it as you come across it.
It has no need for recursive interpretation.
In a sense it is just like machine language with unlimited
macro power built in. It make no distiction between machine
level code and threaded code ( could even be call threaded ).
Dwight
Date: Thu, 5 Jan 2012 22:34:40 -0700
From: bfranchuk at jetnet.ab.ca
To: cctalk at
classiccmp.org
Subject: Re: compilers in assembly - Re: Right toolf for the job (Was: teaching
programming to kids
On 1/5/2012 9:55 PM, Toby Thain wrote:
People
write compilers all the time. If you think they don't, you're
seriously out of the loop.
In assembly?
What is the memory footprint for a simple compiled lanquage,
that can compile itself. I am thinking of word based machine, 16 or more
bits wide and having some basic file I/O and non-recursive subroutine
calls.
--T