In SX Microcontrollers, SX/B Compiler and SX-Key Tool, rwsenser wrote: Greetings. If you are interested in running C on the SX chips, the attached sample C program might be of interest to you. Attached is a sample C program, called prime48.c, that counts the number of prime numbers between 2 and 100, and prints out the answer (which is 25). What is interesting is that this exact same program, unmodified, also works under the Windows VC6 C compiler. The Windows exe file is included in the attached zip. Note that, with the SX48, th results are output with the I/O functions in the C4SX sxio.h library. This SX prgm can also be run on the SX48 without serial support (let the debugger stop at the break point....). This program is a bit of nonsense as who would want to compute/find primes on a microcontroller?? But, it also makes a small point: What other language can be used to write programs that can be tested under Windows and, unmodified, run on the SX? /* in other words, this is a very shameless plug for using C .... */ On a serious note, this all works by using C #ifdef .... #endif sequences to keep the SX and Windows-specific code seperated. In other words, the code is ported to both the SX and Windows platforms. RW Senser ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=208145 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)