Re: Build your own Forth for Microchip PIC (Episode 837)



Op Sun, 24 Jun 2007 10:12:40 -0500 schreef none:

In article <137sb0raq9lv503@xxxxxxxxxxxxxxxxxx>,
Elizabeth D Rather <eratherXXX@xxxxxxxxx> wrote:
none Byron Jeff wrote:
<snip>
It's a Harvard architecture that's difficult to access and slow to
update. So transferring little bits at a time is a highly desireable
trait.

Yes. But you need somewhere to transfer them to that's a little more
accessible than that. PIC doesn't seem to support ram development,
which is the best way to do incremental testing.

This is the reason I'm wanting to use the host as a remote execution
environment. The model you see is:

1. Compile words on the host
2. Transfer compiled code words to RAM.
3. Test/Debug code on target recompiling and reloading as necessary.
4. When finished transfer code to more permanent memory on target.

A perfectly workable model.

I doubt it, what about inline data (like literals, branches etc.)
You have to have two different token interpreters: one for executing code
out of data memory (that would be RAM I assume) and one for code in code
memory. One of them would have to have an extra indirection. As they say
around here: two believers in one bed, the devil sleeps between them.
Look at the 8051s, here it is possible to overlay code and data regions, so
the CPU does not know it's executing from RAM.

<snip>
BTW I realized that I'm still trying to figure out how in the heck forth
compiles a number into a definition. What is the xt for a number?

It's the address for (or call to) a word that pushes the actual value on
the stack, followed by the value:

... [xt of LIT] [value] ...

So the number is inlined into the code.
Code or data space?



There may be different versions for 8, 16, or 32-bit literals. It has
to advance the interpreter pointer or PC beyond the value, in addition
to pushing the value on the stack.

That's problematic for an STC that doesn't have access to the hardware
return stack. It'll have to be inlined.

Many Forths synthesize the second stack, be it the return or data one, no
problem here.

--
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html
.



Relevant Pages

  • Re: IAR compiler & MSP430 problem
    ... the linker isn't telling you when you have run our of RAM. ... which produced a prediction of stack use ... chips have different memory resources. ... // segment address range usage ...
    (comp.arch.embedded)
  • Re: HPGCC: Various problems
    ... > I use HPGCC 2.0. ... It sounds like the same stack problem you mentioned in another thread. ... > do I specify how much memory HPGCC should allocate to my program? ... main ram for TEMPOB growth. ...
    (comp.sys.hp48)
  • Re: Windows CE Threading questions
    ... The next step is reclaiming RAM where possible. ... For instance, memory ... scavenging can occur to reclaim stack pages that are now out of scope. ... will start failing in the kernel prior to being completely out of ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Many threads in Linux
    ... at 64 KB per thread stack is a little more than 12 GB. ... 130MB of resident memory. ... 12 oversubscribed on RAM. ... and if there isn't enough physical memory to keep all of the ...
    (comp.programming.threads)
  • Re: flash player and flash ads
    ... Comments inline. ... You are confusing memory (RAM) with hard drive space. ... Click the startup tab. ...
    (microsoft.public.windowsxp.general)