Re: Build your own Forth for microchip PIC (Episode 839)



In article <1sxqxtculdr4m$.1ly164xd3gegw$.dlg@xxxxxxxxxx>,
Coos Haak <chforth@xxxxxxxxx> wrote:
Op Sat, 23 Jun 2007 18:25:20 -0500 schreef none:

I've asked about a primitive kernel to implement Forth upon. Instead of
looking at existing examples maybe a better approach is to post a
description of my current 16F NPCI bytecode and discuss.
minus ; 4 - minus ( n1 n2 -- n2 - n1 )

I think you have the stack reversed from the normal Forth notation
( n1 n2 -- n1-n2 )
Push n1 first, than n2, and subtracht n2 from n1.

You are correct. My NPCI compiler converts infix to postfix
using a operator stack. Operands pass through unmodified.

I misunderstood where the TOS is. I just finished reading the gforth
manual. TOS is furthest to the right, not the left. Got it.

BTW the primitives do implement the proper stack effect. I get a D- for
listing them incorrectly. Sorry.

BAJ
.



Relevant Pages

  • Re: Replication question
    ... Stack for thread: 3098 CDRD_6 ... tos: 0xc00000003eec4f30 ... state: cond wait ... state: sleeping ...
    (comp.databases.informix)
  • Re: Julian V Nobel thinks TOS....
    ... and thus no need for a STACK. ... TOS in REG is ... because the primitives load the TOS ... > the context switch will do is to restore the TOS. ...
    (comp.lang.forth)
  • Re: C FAQ 3.1
    ... i++ is post increment, ... (for VXworks first few parameters are in Registers) ... If the parameters are passed in stack, ... at TOS, last parameter at TOS?, ...
    (comp.lang.c)
  • Re: Any "standard" names for..
    ... like special registers and the rest of the data stack as something like ... Simply TOS in a separate register, and its cheaper than OVER SWAP. ... utility work register A. NUP then is copy top of machine stack to A, ...
    (comp.lang.forth)
  • Re: Are software-visible registers needed?
    ... That makes the TOS an extreely buzy location, and all the extra stack-internal load/store operations cost more issue bandwidth than what you save by only allowing TOS operations. ... A set of registers which are automatically rotated when making function calls, and which will/can overflow when/if you run out of real register stack space. ...
    (comp.arch)