FIBOL.b 906 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Input file : ./tests/inputs/FIBOL.EXE
  3. * File type : EXE
  4. */
  5. #include "dcc.h"
  6. int proc_1 (int arg0)
  7. /* Takes 2 bytes of parameters.
  8. * High-level language prologue code.
  9. * C calling convention.
  10. */
  11. {
  12. int loc1; /* si */
  13. int loc2; /* ax */
  14. loc1 = arg0;
  15. if (loc1 > 2) {
  16. loc2 = (proc_1 ((loc1 - 1)) + proc_1 ((loc1 + 0xfffe)));
  17. }
  18. else {
  19. loc2 = 1;
  20. }
  21. return (loc2);
  22. }
  23. void main ()
  24. /* Takes no parameters.
  25. * High-level language prologue code.
  26. * Contains instructions not normally used by compilers.
  27. */
  28. {
  29. int loc1;
  30. int loc2;
  31. int loc3;
  32. int loc4;
  33. printf ("Input number of iterations: ");
  34. scanf ("%d", &loc1, );
  35. loc3 = 1;
  36. while ((loc3 <= loc1)) {
  37. printf ("Input number: ");
  38. scanf ("%d", &loc2, );
  39. printf ("fibonacci(%d) = %u\n", loc2, proc_1 (loc2));
  40. loc3 = (loc3 + 1);
  41. } /* end of while */
  42. exit (0);
  43. }