root/zBoot/piggyback.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main

   1 #include <stdio.h>
   2 
   3 int main(int argc, char *argv[])
     /* [previous][next][first][last][top][bottom][index][help] */
   4 {
   5         int c, n=0, len=0;
   6 
   7         printf( 
   8                 ".globl _input_data\n"
   9                 ".data\n"
  10                 "_input_data:\n");
  11 
  12         while ((c=getchar()) != EOF)
  13         {
  14                 len++;
  15                 if (!n) printf("\n.byte "); else printf(",");
  16                 printf("%d", c);
  17                 n = (n+1) & 0x1f;
  18         }
  19 
  20         printf("\n\n");
  21 
  22         fprintf(stderr, "Compressed size %d.\n", len);
  23 
  24 
  25         printf( ".globl _input_len\n"
  26                 ".align 2\n"
  27                 "_input_len:\n"
  28                 "\t.long %d\n", len);
  29 
  30         exit(0);
  31 
  32 }

/* [previous][next][first][last][top][bottom][index][help] */