From f2b214b0dff95d6bb79cbb5b6ff5ba9d90f655c9 Mon Sep 17 00:00:00 2001 From: oharboe Date: Wed, 2 Jan 2008 21:52:27 +0000 Subject: Initial import from www.ecosforge.net --- zpu/hdl/zpu4/test/hello/hello.c | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 zpu/hdl/zpu4/test/hello/hello.c (limited to 'zpu/hdl/zpu4/test/hello/hello.c') diff --git a/zpu/hdl/zpu4/test/hello/hello.c b/zpu/hdl/zpu4/test/hello/hello.c new file mode 100644 index 0000000..ea3dbb8 --- /dev/null +++ b/zpu/hdl/zpu4/test/hello/hello.c @@ -0,0 +1,51 @@ +/* + +zpu-elf-gcc -abel `pwd`/hello.c -o hello.elf -Wl,--relax -Wl,--gc-sections -g +zpu-elf-objdump --disassemble-all >hello.dis hello.elf +zpu-elf-objcopy -O binary hello.elf hello.bin + + * */ +#include + +int j; +int k; + +int main(int argc, char **argv) +{ + int i; + for (i=0; i< 10; i++) + { + puts("Hello world 1\n"); + puts("Hello world 2\n"); + j=-4; + if ((j>>1)!=-2) + { + abort(); + } + + k=10; + if (k*j!=-40) + { + abort(); + } + + j=10; + k=10000000; + if (k*j!=100000000) + { + abort(); + } + + j=0x80000000; + k=0xffffffff; + if (j>k) + { + abort(); + } + } + if (i!=10) + { + abort(); + } + +} -- cgit v1.1 From 4a419c5aa7ef974279042ebfba2aed2adab197db Mon Sep 17 00:00:00 2001 From: oharboe Date: Thu, 21 Feb 2008 18:59:45 +0000 Subject: * zpu/zpu/hdl/index.html. Sharpened instructions and shows two working examples. Small & medium ZPU. * got zpu4/src/simzpu_medium.do working again. --- zpu/hdl/zpu4/test/hello/hello.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'zpu/hdl/zpu4/test/hello/hello.c') diff --git a/zpu/hdl/zpu4/test/hello/hello.c b/zpu/hdl/zpu4/test/hello/hello.c index ea3dbb8..609c163 100644 --- a/zpu/hdl/zpu4/test/hello/hello.c +++ b/zpu/hdl/zpu4/test/hello/hello.c @@ -1,10 +1,6 @@ /* - -zpu-elf-gcc -abel `pwd`/hello.c -o hello.elf -Wl,--relax -Wl,--gc-sections -g -zpu-elf-objdump --disassemble-all >hello.dis hello.elf -zpu-elf-objcopy -O binary hello.elf hello.bin - - * */ + * Small hello world example, does not use printf() + */ #include int j; -- cgit v1.1