PKP
VS1000 P
ROGRAMMER
’
S
G
UIDE
VSMPG
7
Examples
For more information and examples, check the VLSI Solution’s website, click Support,
then select Software. You can then find links for full VS1000 applications and smaller
VS1000 examples.
VS1000 evaluation boards also have source code available, so check out Support /
Evaluation Boards as well.
There are also VS1000-specific example projects for VSIDE.
See VSDSP Forum for general talk about VS1000 and other chips from
http://www.vsdsp-forum.com/
.
7.1
Hello, World!
The first example of writing code for the VS1000 is the traditional “Hello, World!” exam-
ple, which is compiled and linked. Then the RS-232 ROM monitor interface (vs3emu) is
used to load and execute the code.
The contents of the file
hello.c
is:
/* hello.c : A Hello World example. */
#include <stdio.h>
// main() is the program entry point. It is entered via a vector,
// which is statically linked to address 0x0050 in module c.o
void main(void) {
puts("Hello, World!");
}
7.1.1
Compiling
The “hello.c” file is compiled using vcc with a command line such as:
vcc -P130 -O -fsmall-code -I lib -o hello.o hello.c
This creates a coff object file hello.o. The parameteres that were passed to vcc are:
-P130
Treats warning 130 (“can’t find prototype”) as an error.
-O
Optimize
-fsmall-code
Use 16-bit code model (uses libc16 libraries)
-o hello.o
Output file is hello.o
-I lib
subdirectory “
lib
” contains include files
hello.c
input file
Rev. 0.20
2011-10-04
Page