Hello Mark, Erich, AmForthers,

I agreed with Mark's comment below 

>> It seems that the intent of the refcard was to document the things that
>> are compiled into the system.

and commented  

> For me, the scope of the/each refcard is defined by the
> distribution build for each architecture (AVR8, msp430, etc.). If the
> refcard script were part of the hex build process then a custom
> refcard could be a product of the build process also. 

For AVR8, the .lst file produced as part of the build process lists
all the .asm files used in building the hex files. Modifying Mark's
perl script from

https://sourceforge.net/p/amforth/mailman/message/37060541/

so that it uses only the included files listed in the .lst file, a
list of words with the their documentation fields can output. These
are specific to the individual build, rather than to the general
assembly source tree.  Giving something like this (see end of
message). As Mark pointed out

>> There is still the issue of files that don't have the 3 lines at the top
>> of stack effects, category and description.

Making these (assembly) files compliant would require some coordinated
effort - some of which has been already done I believe, but after that
a build specific ref card documenting built-in words could just
be another automated part of the hex build process. 

Not perhaps the perfect ref card - whatever that is, but achievable
and with a clearly defined scope. Certainly something I would make use
of.  

Best wishes,
Tristan

Edited example (text) output of the modified script for uno.lst

....

Arithmetics
-----------

VOC      : 1- 
DSTACK   : ( n1 -- n2 )
RSTACK   : 
CSTACK   : 
DESC     :  optimized decrement
CATEGORY :  Arithmetics
ASM_FILE : amforth-6.92/avr8/words/1minus.asm

VOC      : 1+ 
DSTACK   : ( n1|u1 -- n2|u2 )
RSTACK   : 
CSTACK   : 
DESC     :  optimized increment
CATEGORY :  Arithmetics
ASM_FILE : amforth-6.92/avr8/words/1plus.asm

VOC      : 2/ 
DSTACK   : ( n1 -- n2 )
RSTACK   : 
CSTACK   : 
DESC     :  arithmetic shift right
CATEGORY :  Arithmetics
ASM_FILE : amforth-6.92/avr8/words/2slash.asm


Compiler
--------

VOC      : 2literal 
DSTACK   : ( -- x1 x2 )
RSTACK   : 
CSTACK   : (C: x1 x2 -- )
DESC     :  compile a cell pair literal in colon definitions
CATEGORY :  Compiler
ASM_FILE : amforth-6.92/common/words/2literal.asm

VOC      : again 
DSTACK   : ( -- )
RSTACK   : 
CSTACK   : (C: dest -- )
DESC     :  compile a jump back to dest
CATEGORY :  Compiler
ASM_FILE : amforth-6.92/common/words/again.asm

VOC      : ahead 
DSTACK   : ( f -- )
RSTACK   : 
CSTACK   : (C: -- orig )
DESC     :  do a unconditional branch
CATEGORY :  Compiler
ASM_FILE : amforth-6.92/common/words/ahead.asm

....




_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to