OpenCores
URL https://opencores.org/ocsvn/zpu/zpu/trunk

Subversion Repositories zpu

[/] [zpu/] [trunk/] [zpu/] [example/] [hello world/] [hello.c] - Blame information for rev 96

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 95 oharboe
/*
2
 * Small hello world example, does not use printf()
3
 */
4
#include <stdio.h>
5
 
6
int j;
7
int k;
8
 
9
int main(int argc, char **argv)
10
{
11
        int i;
12
  for (i=0; i< 10; i++)
13
    {
14 96 oharboe
      puts("Hello world 1\n");
15
      puts("Hello world 2\n");
16 95 oharboe
    j=-4;
17
    if ((j>>1)!=-2)
18
    {
19
        abort();
20
    }
21
 
22
    k=10;
23
    if (k*j!=-40)
24
    {
25
        abort();
26
    }
27
 
28
    j=10;
29
    k=10000000;
30
    if (k*j!=100000000)
31
    {
32
        abort();
33
    }
34
 
35
    j=0x80000000;
36
    k=0xffffffff;
37
    if (j>k)
38
    {
39
        abort();
40
    }
41
    }
42
    if (i!=10)
43
    {
44
        abort();
45
    }
46
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.