[PicForth] Re: Data table usage and general error tracing ?

easlab at absamail.co.za easlab at absamail.co.za
Fri Jan 23 15:19:10 CET 2004


> | I try to compile:
> | table
> |    table> "9 8 7"  \ try also <" 9 8 7 "> ; try also <9,>
> | end-table
> | 
> | Q1. Where is the mistake(s) in my attempted code ?

Samuel Tardieu wrote:
> Two errors:
> 
>   1) You didn't include the table name after table
>   2) You are not supposed to include the quote (in a Forth
>      signature, the quotes indicate that the parsing will
>      happen at word execution and that the parameters are
>      not to be expected on the stack)
> 
> For example, you can do:
> 
>   table foobar
>     table> 9 8 7
>   end-table
> 
>   main : main ( -- ) ;
> 
> You will see the following snippet of code
> 
> 0x0005  3007    movlw   0x07  == 7 -> W
> 0x0006  00A4    movwf   0x24  == W -> [tos]
> 0x0007  3008    movlw   0x08   == 8 -> W
> 0x0008  00A3    movwf   0x23  == inc(tos); W -> [tos]
> 0x0009  3009    movlw   0x09  == 9 -> W
> 0x000A  00A2    movwf   0x22  == inc(tos); W -> [tos]

OK, more smart optimising .

I can't see how to do eg:
  foobar[1] ->   foobar[2]

IMO, inductive (by examples) is not a substitute for a proper syntax
definition eg. of the 'native' words.


> | Q2. How is it possible to capture the error trace to a file ?
> 
> Redirect standard error to a pager such as less for example, or
> use a bigger terminal.

I belong to those just wishing to find a better than assembly way of 
programing pics, and am not prepared to allocate much resources to
researching linux nor forth.

It may be usefull to now know what '2>'  means, but if potential
picforth users have to make such research, they will just rather abort.

I read:
  >  * The words table and tc: have been removed as they were inefficient
  >   and useless in their current form.

 What is the current situation - will the 'table facility' be available ?

Thanks,

== Chris Glur.






More information about the PicForth mailing list