Re: [Amforth] Ref Card Generation -- working hack
I may as well be complete. http://ipreferpi.eu/DL/padding.diff Those are the fixes for the padding warnings while building. Not really terribly important but better all the way than half-way there. This one though actually supersedes the other for ud-star.asm and q-negate.asm since they have a lesser change in the first diff I posted. Their fixes of adding the ",0" are on lines 12 and 15 respectively and could just be fixed manually. Now I'm really done and the weekend is still half a day away. On Fri, Jul 17, 2020 at 1:20 PM Mark Roth wrote: > ugh, ignore the ">" at the start of the script lines obviously. I had the > whole mess quoted so it made a mockery of things. > > On Fri, Jul 17, 2020 at 12:40 PM Mark Roth wrote: > >> I cleaned up my diff of the svn (amforth-code) and put it up to see if it >> would be helpful. Be sure to look through the comments on the changed .asm >> files. In particular the description on abort-string.asm. I'm not seeing >> the -2 error and that is a set of comments I pulled from an older revision. >> It can be found here. >> http://ipreferpi.eu/DL/mywork.diff >> >> To build the refcard page using the (mostly) original script I had to >> resort to dumping the avr8 and common words into a big pile and let the >> perl voodoo do what it do. So, that is my disclaimer that it is an avr8 >> AmForth Refcard only. One could use the same technique to make the other >> flavors as well I suppose. To do that I just made a little helper script >> that I run from the doc directory. >> >> #!/bin/bash >>> mkdir ../tempwords >>> cp -r ../common/words ../tempwords >>> cp -r ../avr8/words ../tempwords >>> cd ../tools/ ; perl make-refcard-rst ; cd ../doc >>> make htdocs >>> #make onlyepub >>> rm -r ../tempwords >> >> >> It does the trick for me locally anyhow. >> >> So that completes my AmForth conversion via AmForth Weekend 1 >> :P >> >> All the best (until the next one), >> Mark >> >> >> On Thu, Jul 16, 2020 at 11:02 AM Mark Roth wrote: >> >>> Of those you see in the list, there are about 20 .asm files that aren't >>> included in even the 8k core build. I jammed about a dozen of them into my >>> appl_core dictionary include file just to try and fill it up. Plus of >>> course the hardware drivers that wouldn't be included anyhow if you don't >>> need them. I should probably go through my notes and start making patches >>> for all the files I changed so they can be vetted. I'm sure I made some >>> errors (or just didn't know from looking at the comments) that would need >>> to be sorted out. :) >>> >>> On Thu, Jul 16, 2020 at 9:53 AM Tristan Williams >>> wrote: >>> Hello Mark, Brilliant! There are AmForth words there I hadn't realised it had. Best wishes, Tristan On 16Jul20 00:49, Mark Roth wrote: > It's almost there at least as a page that can temporarily replace the > temporary v5.5 one. This is generated from the current svn sources and > consists of the avr8 and common words directories. I cleaned up as many of > the files that I could (and those will for sure need some Forth eyes on > them) by taking info from older versions when the comment block was > missing. The entire thing is generated by copying the avr8/words and > common/words into a temp directory then running the refcard python file > against that. You can take a look at it here. > http://ipreferpi.eu/htdocs/TG/refcard.html > > On Mon, Jul 13, 2020 at 10:19 PM Mark Roth wrote: > > > I see there are a few duplicates but I'm not really sure why. Like > > RECOGNIZE from recognize.asm. It must have something to do with the way the > > msp430 header is formatted that is different from other ones since it isn't > > all of them. I'm sure it is in that voodoo of slashes somewhere... > > > > all the best, > > Mark > > > >> > >> CLIPPED > > ___ > Amforth-devel mailing list for http://amforth.sf.net/ > Amforth-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/amforth-devel > ___ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel >>> ___ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel
Re: [Amforth] Ref Card Generation -- working hack
I cleaned up my diff of the svn (amforth-code) and put it up to see if it would be helpful. Be sure to look through the comments on the changed .asm files. In particular the description on abort-string.asm. I'm not seeing the -2 error and that is a set of comments I pulled from an older revision. It can be found here. http://ipreferpi.eu/DL/mywork.diff To build the refcard page using the (mostly) original script I had to resort to dumping the avr8 and common words into a big pile and let the perl voodoo do what it do. So, that is my disclaimer that it is an avr8 AmForth Refcard only. One could use the same technique to make the other flavors as well I suppose. To do that I just made a little helper script that I run from the doc directory. #!/bin/bash > mkdir ../tempwords > cp -r ../common/words ../tempwords > cp -r ../avr8/words ../tempwords > cd ../tools/ ; perl make-refcard-rst ; cd ../doc > make htdocs > #make onlyepub > rm -r ../tempwords It does the trick for me locally anyhow. So that completes my AmForth conversion via AmForth Weekend 1 :P All the best (until the next one), Mark On Thu, Jul 16, 2020 at 11:02 AM Mark Roth wrote: > Of those you see in the list, there are about 20 .asm files that aren't > included in even the 8k core build. I jammed about a dozen of them into my > appl_core dictionary include file just to try and fill it up. Plus of > course the hardware drivers that wouldn't be included anyhow if you don't > need them. I should probably go through my notes and start making patches > for all the files I changed so they can be vetted. I'm sure I made some > errors (or just didn't know from looking at the comments) that would need > to be sorted out. :) > > On Thu, Jul 16, 2020 at 9:53 AM Tristan Williams wrote: > >> Hello Mark, >> >> Brilliant! There are AmForth words there I hadn't realised it had. >> >> Best wishes, >> Tristan >> >> On 16Jul20 00:49, Mark Roth wrote: >> > It's almost there at least as a page that can temporarily replace the >> > temporary v5.5 one. This is generated from the current svn sources and >> > consists of the avr8 and common words directories. I cleaned up as many >> of >> > the files that I could (and those will for sure need some Forth eyes on >> > them) by taking info from older versions when the comment block was >> > missing. The entire thing is generated by copying the avr8/words and >> > common/words into a temp directory then running the refcard python file >> > against that. You can take a look at it here. >> > http://ipreferpi.eu/htdocs/TG/refcard.html >> > >> > On Mon, Jul 13, 2020 at 10:19 PM Mark Roth >> wrote: >> > >> > > I see there are a few duplicates but I'm not really sure why. Like >> > > RECOGNIZE from recognize.asm. It must have something to do with the >> way the >> > > msp430 header is formatted that is different from other ones since it >> isn't >> > > all of them. I'm sure it is in that voodoo of slashes somewhere... >> > > >> > > all the best, >> > > Mark >> > > >> > >> >> > >> CLIPPED >> > >> > ___ >> > Amforth-devel mailing list for http://amforth.sf.net/ >> > Amforth-devel@lists.sourceforge.net >> > https://lists.sourceforge.net/lists/listinfo/amforth-devel >> > >> >> >> ___ >> Amforth-devel mailing list for http://amforth.sf.net/ >> Amforth-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/amforth-devel >> > ___ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel
Re: [Amforth] Ref Card Generation -- working hack
Of those you see in the list, there are about 20 .asm files that aren't included in even the 8k core build. I jammed about a dozen of them into my appl_core dictionary include file just to try and fill it up. Plus of course the hardware drivers that wouldn't be included anyhow if you don't need them. I should probably go through my notes and start making patches for all the files I changed so they can be vetted. I'm sure I made some errors (or just didn't know from looking at the comments) that would need to be sorted out. :) On Thu, Jul 16, 2020 at 9:53 AM Tristan Williams wrote: > Hello Mark, > > Brilliant! There are AmForth words there I hadn't realised it had. > > Best wishes, > Tristan > > On 16Jul20 00:49, Mark Roth wrote: > > It's almost there at least as a page that can temporarily replace the > > temporary v5.5 one. This is generated from the current svn sources and > > consists of the avr8 and common words directories. I cleaned up as many > of > > the files that I could (and those will for sure need some Forth eyes on > > them) by taking info from older versions when the comment block was > > missing. The entire thing is generated by copying the avr8/words and > > common/words into a temp directory then running the refcard python file > > against that. You can take a look at it here. > > http://ipreferpi.eu/htdocs/TG/refcard.html > > > > On Mon, Jul 13, 2020 at 10:19 PM Mark Roth wrote: > > > > > I see there are a few duplicates but I'm not really sure why. Like > > > RECOGNIZE from recognize.asm. It must have something to do with the > way the > > > msp430 header is formatted that is different from other ones since it > isn't > > > all of them. I'm sure it is in that voodoo of slashes somewhere... > > > > > > all the best, > > > Mark > > > > > >> > > >> CLIPPED > > > > ___ > > Amforth-devel mailing list for http://amforth.sf.net/ > > Amforth-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > > > ___ > Amforth-devel mailing list for http://amforth.sf.net/ > Amforth-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/amforth-devel > ___ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel
Re: [Amforth] Ref Card Generation -- working hack
Hello Mark, Brilliant! There are AmForth words there I hadn't realised it had. Best wishes, Tristan On 16Jul20 00:49, Mark Roth wrote: > It's almost there at least as a page that can temporarily replace the > temporary v5.5 one. This is generated from the current svn sources and > consists of the avr8 and common words directories. I cleaned up as many of > the files that I could (and those will for sure need some Forth eyes on > them) by taking info from older versions when the comment block was > missing. The entire thing is generated by copying the avr8/words and > common/words into a temp directory then running the refcard python file > against that. You can take a look at it here. > http://ipreferpi.eu/htdocs/TG/refcard.html > > On Mon, Jul 13, 2020 at 10:19 PM Mark Roth wrote: > > > I see there are a few duplicates but I'm not really sure why. Like > > RECOGNIZE from recognize.asm. It must have something to do with the way the > > msp430 header is formatted that is different from other ones since it isn't > > all of them. I'm sure it is in that voodoo of slashes somewhere... > > > > all the best, > > Mark > > > >> > >> CLIPPED > > ___ > Amforth-devel mailing list for http://amforth.sf.net/ > Amforth-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/amforth-devel > ___ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel
Re: [Amforth] Ref Card Generation -- working hack
It's almost there at least as a page that can temporarily replace the temporary v5.5 one. This is generated from the current svn sources and consists of the avr8 and common words directories. I cleaned up as many of the files that I could (and those will for sure need some Forth eyes on them) by taking info from older versions when the comment block was missing. The entire thing is generated by copying the avr8/words and common/words into a temp directory then running the refcard python file against that. You can take a look at it here. http://ipreferpi.eu/htdocs/TG/refcard.html On Mon, Jul 13, 2020 at 10:19 PM Mark Roth wrote: > I see there are a few duplicates but I'm not really sure why. Like > RECOGNIZE from recognize.asm. It must have something to do with the way the > msp430 header is formatted that is different from other ones since it isn't > all of them. I'm sure it is in that voodoo of slashes somewhere... > > all the best, > Mark > >> >> CLIPPED ___ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel
[Amforth] Ref Card Generation -- working hack
I do see that the lists don't get properly sorted either. Still very rough... ___ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel
Re: [Amforth] Ref Card Generation -- working hack
I see there are a few duplicates but I'm not really sure why. Like RECOGNIZE from recognize.asm. It must have something to do with the way the msp430 header is formatted that is different from other ones since it isn't all of them. I'm sure it is in that voodoo of slashes somewhere... all the best, Mark On Mon, Jul 13, 2020 at 10:09 PM Mark Roth wrote: > So here is a working hack to make a refcard with both the avr8/works and > common/words directory. Since I don't even sort of speak Perl I'll leave > any real fixes to someone who does. However, I made a few notes pointing > out the things that were the issue before. > There is still the issue of files that don't have the 3 lines at the top > of stack effects, category and description. It is easy to see which files > need to be fixed so they can be scanned correctly. The ones in the > unclassified group at the end can be a little tougher to find. I had to > search for <.db "-1"> to find that one in num-constants.asm. Those did fail > pretty gracefully though. > > tl;dnr > This works in a hackish sort of way. Still work to do but closer now. > > = START make-refcard-rst === > > #!/usr/bin/perl > use strict; > > # local hashes > my %XT; > my %VOC; > my %ASM; > my %USEDBY; > my %DESCRIPTION; > my %DSTACK; > my %RSTACK; > my %CSTACK; > my %CATEGORY; > my %TYPEOF; > > my $version="6.9"; > > my $texdir="../doc/source/TG"; > > my $asmdir="../common/words"; > my $devasmdir="../avr8/words"; > > sub readASM { > my ($filename) = @_; > open(ASM, $filename) or die ("$filename: $!\n"); > my @ASM = ; > close(ASM); > my $ASM = ""; > my ($lbl, $state, $voc, $xt, $dstack, $rstack, $cstack, $category, > $typeof); > my ($line1, $line2, $line3, $description) = ("","","", ""); > > # Added to try and remove the prevline issues > # before fixing correctly. > $line1 = $ASM[0]; # stack--effects > $line2 = $ASM[1]; # category > $line3 = $ASM[2]; # description > > # From this point on all prevline vars are now: > # prevline3 is now $line1 > # prevline2 is now $line2 > # prevline1 is now $line3 > # This change is just to clarify that the first three > # lines have to be the info we are looking for. It was > # how it worked before but more loosly bound. > > foreach my $line (@ASM) { > chomp($line); > # > next if $line=~/\.if/; > $line =~ s/_VE_HEAD/VE_HEAD/; > $ASM .= $line; > > if($line=~/^VE_(.*):/) { > # start a new definition > $ASM = ""; > $lbl = "XT_$1"; > $state = "new_header_found"; > $voc = "(unnamed)"; > $category = "unclassified"; > $dstack = "( -- )"; > $dstack = "($1)" if $line1=~/\([S]?:?([^\)]+)/; > $rstack = ""; > $rstack = "(R: $1)" if $line1=~/R:\s+([^)]+)\)/; > $cstack = ""; > $cstack = "(C: $1)" if $line1=~/C:\s+([^)]+)\)/; > $description = $1 if $line3=~/^;(.*)/; > if( $line2=~/;(.+)$/) { > $category = $1; > } > next; > } > > if($line=~/^;VE_(.*):/) { > # start a new definition > $ASM = ""; > $lbl = "XT_$1"; > $state = "new_header_found"; > $voc = "(hidden)"; > $dstack = $line1; > $dstack = "( -- )"; > $dstack = "($1)" if $line1=~/\([S]?:?([^\)]+)/; > $rstack = ""; > $rstack = "R($1)" if $line1=~/R:\s+(.+)\)/; > $cstack = ""; > $cstack = "(C: $1)" if $line1=~/C:\s+(.+)\)/; > $description = $1 if $line3=~/^;(.*)/; > if( $line2=~/;(.+)$/) { > $category = $1; > } > $category = "internal/hidden"; > next; > } > if($state =~ /new_header_found/ && $line=~/.dw\s*(.*)/) { > $state = "new_voc_header"; > next; > } > if ($state =~ /new_voc_header/ && $line=~/.db\s*(.*)/) { > my @voc = split/,/, $1; > my $i=0; > $voc = ""; > foreach my $v (@voc) { > # next if $i++ == 0; > print "[$v]"; > $voc .= chr(hex($1)) if $v=~/\$([\da-fA-F]+)/; > $voc .= $1 if $v=~/"(\S+)"/; > } > $state = "vocabulary entry found"; > next; > } > if($line=~/^XT_(.*)/){ > $state = "xt_found"; > next; > } > if($state=~/xt_found/ && $line=~/.dw\s+(\w+)/) { > $xt = $1; > $state = "header_complete"; > next; > } > if($state =~ /header_complete/) { > $DSTACK{$lbl} = $dstack; > $RSTACK{$lbl} = $rstack; > $CSTACK{$lbl} = $cstack; > > $XT{$lbl} = $xt; > $VOC{$lbl} = $voc; > $DESCRIPTION{$lbl} = $description; > push @{$CATEGORY{$category}}, $lbl; > $state = "parsing_body"; > next; > } > > if($state =~ /parsing_body/) { > $ASM{$lbl} = $ASM if $ASM=~/\w/; > } > } > } > > sub _head { > my ($title) = @_; > my ($r); > open(I, "refcard-head.rst") or die "refcard header not found"; > while() { > s/\*VERSION\*/$version/g; > $r .= $_ > } > close(I); > return $r; > }
[Amforth] Ref Card Generation -- working hack
So here is a working hack to make a refcard with both the avr8/works and common/words directory. Since I don't even sort of speak Perl I'll leave any real fixes to someone who does. However, I made a few notes pointing out the things that were the issue before. There is still the issue of files that don't have the 3 lines at the top of stack effects, category and description. It is easy to see which files need to be fixed so they can be scanned correctly. The ones in the unclassified group at the end can be a little tougher to find. I had to search for <.db "-1"> to find that one in num-constants.asm. Those did fail pretty gracefully though. tl;dnr This works in a hackish sort of way. Still work to do but closer now. = START make-refcard-rst === #!/usr/bin/perl use strict; # local hashes my %XT; my %VOC; my %ASM; my %USEDBY; my %DESCRIPTION; my %DSTACK; my %RSTACK; my %CSTACK; my %CATEGORY; my %TYPEOF; my $version="6.9"; my $texdir="../doc/source/TG"; my $asmdir="../common/words"; my $devasmdir="../avr8/words"; sub readASM { my ($filename) = @_; open(ASM, $filename) or die ("$filename: $!\n"); my @ASM = ; close(ASM); my $ASM = ""; my ($lbl, $state, $voc, $xt, $dstack, $rstack, $cstack, $category, $typeof); my ($line1, $line2, $line3, $description) = ("","","", ""); # Added to try and remove the prevline issues # before fixing correctly. $line1 = $ASM[0]; # stack--effects $line2 = $ASM[1]; # category $line3 = $ASM[2]; # description # From this point on all prevline vars are now: # prevline3 is now $line1 # prevline2 is now $line2 # prevline1 is now $line3 # This change is just to clarify that the first three # lines have to be the info we are looking for. It was # how it worked before but more loosly bound. foreach my $line (@ASM) { chomp($line); # next if $line=~/\.if/; $line =~ s/_VE_HEAD/VE_HEAD/; $ASM .= $line; if($line=~/^VE_(.*):/) { # start a new definition $ASM = ""; $lbl = "XT_$1"; $state = "new_header_found"; $voc = "(unnamed)"; $category = "unclassified"; $dstack = "( -- )"; $dstack = "($1)" if $line1=~/\([S]?:?([^\)]+)/; $rstack = ""; $rstack = "(R: $1)" if $line1=~/R:\s+([^)]+)\)/; $cstack = ""; $cstack = "(C: $1)" if $line1=~/C:\s+([^)]+)\)/; $description = $1 if $line3=~/^;(.*)/; if( $line2=~/;(.+)$/) { $category = $1; } next; } if($line=~/^;VE_(.*):/) { # start a new definition $ASM = ""; $lbl = "XT_$1"; $state = "new_header_found"; $voc = "(hidden)"; $dstack = $line1; $dstack = "( -- )"; $dstack = "($1)" if $line1=~/\([S]?:?([^\)]+)/; $rstack = ""; $rstack = "R($1)" if $line1=~/R:\s+(.+)\)/; $cstack = ""; $cstack = "(C: $1)" if $line1=~/C:\s+(.+)\)/; $description = $1 if $line3=~/^;(.*)/; if( $line2=~/;(.+)$/) { $category = $1; } $category = "internal/hidden"; next; } if($state =~ /new_header_found/ && $line=~/.dw\s*(.*)/) { $state = "new_voc_header"; next; } if ($state =~ /new_voc_header/ && $line=~/.db\s*(.*)/) { my @voc = split/,/, $1; my $i=0; $voc = ""; foreach my $v (@voc) { # next if $i++ == 0; print "[$v]"; $voc .= chr(hex($1)) if $v=~/\$([\da-fA-F]+)/; $voc .= $1 if $v=~/"(\S+)"/; } $state = "vocabulary entry found"; next; } if($line=~/^XT_(.*)/){ $state = "xt_found"; next; } if($state=~/xt_found/ && $line=~/.dw\s+(\w+)/) { $xt = $1; $state = "header_complete"; next; } if($state =~ /header_complete/) { $DSTACK{$lbl} = $dstack; $RSTACK{$lbl} = $rstack; $CSTACK{$lbl} = $cstack; $XT{$lbl} = $xt; $VOC{$lbl} = $voc; $DESCRIPTION{$lbl} = $description; push @{$CATEGORY{$category}}, $lbl; $state = "parsing_body"; next; } if($state =~ /parsing_body/) { $ASM{$lbl} = $ASM if $ASM=~/\w/; } } } sub _head { my ($title) = @_; my ($r); open(I, "refcard-head.rst") or die "refcard header not found"; while() { s/\*VERSION\*/$version/g; $r .= $_ } close(I); return $r; } sub _foot { } sub printLaTeX { my ($title) = @_; open(LATEX, ">$texdir/refcard.rst") or die "$!\n";; print LATEX _head($title); foreach my $category (sort keys %CATEGORY) { next if $category=~/^\s*$/; next if $category=~/internal/; print "$category\n"; my $cattxt = $category; $cattxt =~s/\s+(.*)/$1/; print LATEX "\n$cattxt\n". "-" x length($cattxt) . "\n\n"; foreach my $lbl (sort @{$CATEGORY{$category}}) { my $xt = $XT{$lbl}; my $voc = $VOC{$lbl}; my $shortlbl = substr($lbl, 3); my $descr = $DESCRIPTION{$lbl}; my $dstack = $DSTACK{$lbl}; my $rstack = $RSTACK{$lbl}; my $cstack =