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

Subversion Repositories copyblaze

[/] [copyblaze/] [trunk/] [copyblaze/] [sw/] [code/] [pbcc/] [test10/] [test10.c] - Rev 67

Go to most recent revision | Compare with Previous | Blame | View Log

// test array of ints
 
#define ARRAY_SIZE 10
 
volatile short numbers[ARRAY_SIZE] = {9,8,7,6,5,4,3,2,1,0};
 
void main()
{
  short i, j, temp;
 
  for (i = (ARRAY_SIZE - 1); i > 0; i--)
  {
    for (j = 1; j <= i; j++)
    {
      if (numbers[j-1] > numbers[j])
      {
        temp = numbers[j-1];
        numbers[j-1] = numbers[j];
        numbers[j] = temp;
      }
    }
  }
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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