On Sun, May 08, 2005 at 04:57:09PM -0400, Victor Faria wrote: > BAJ, how about a sneak peek ? :-). Why not? Here is a Sieve of Erastosthenes that the last person who asked to work on it implemented. I have his code updates, but I haven't taken the time to work on them. This program compiles with the NPCI compiler and runs on the PIC interpreter. I also have a C based interpreter that I'm still fleshing out. It's not vaporware, just not yet released. BAJ ------------------------- sieve.npc --------------------------- // // prime sieve // test of bitset data type // // sieve of Erastosthenes // algorithm for finding prime numbers // following execution, // one values in bit vector represent primes // int bits char i char a,b proc sieve(int values) // first initialize all cells bits = 0xffff // now search for non-zero cells a = 2 while (a*a <= 16) if (values:a) b = i + 1 // inv: i has no factors while (b < 16) values:b = 0 b = b + a endwhile // inv: all multiples of i have been cleared endif a = a + 1; endwhile endproc proc main() print "interptest5\n"; bits = 0; call sieve(bits); print "bits ", bits, "\n"; i = 0 while (i < 16) if (bits:i) print i, " is prime\n" endif // i += 1 i = i + 1 endwhile endproc ------------------------------------------------------------------- > victor > ----- Original Message ----- > From: "Byron A Jeff" > To: "Microcontroller discussion list - Public." > Sent: Sunday, May 08, 2005 1:42 PM > Subject: Re: [PIC:] XPL0 language > > > > On Sun, May 08, 2005 at 10:15:07AM -0700, James Newtons Massmind wrote: > > > http://www.finitesite.com/d3jsys/README-NPCI.html > > > NPCI... It came to me in a dream last night... Pretty sad when > you > > > dream about unfinished PIC languages... > > > > That's really sad. ;-) > > > > I don't even dream about NPCI and I wrote it. > > > > Getting NPCI stable is on my list of summer projects. The last time I > > worked on it NPCI actually worked pretty well. I didn't release it because > > I didn't have time to support it. But I will soon. > > > > My plan is to incoporate it with a bootloader. With PICs with 4K to 8K > > self programmable program memory, there really isn't a need for a separate > > programmer or external program memory. > > > > BAJ > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist