home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s038 / 11.ddi / SSCOPE.LIF / CUTILS.LST < prev    next >
Encoding:
File List  |  1992-07-02  |  6.3 KB  |  146 lines

  1. iC-386  COMPILER   CUTILS                                                                    09/05/90 12:11:31  PAGE   1
  2.  
  3.  
  4. iRMX III iC-386 COMPILER V4.3, COMPILATION OF MODULE CUTILS
  5. OBJECT MODULE PLACED IN cutils.obj
  6. COMPILER INVOKED BY: :lang:ic386 cutils.c compact object(cutils.obj) print(cutils.lst) ram optimize(0) dn(0) debug defin
  7.                 -e(rmx3) searchinclude(/lib/ic386/) 
  8.  
  9.  line level  incl 
  10.  
  11.     1             /**********************************************************************/
  12.     2             /*                                                                    */
  13.     3             /*            CSAMP Sample Program, Support Procedures                */
  14.     4             /*                                                                    */
  15.     5             /**********************************************************************/
  16.     6             
  17.     7             #include <stdarg.h>
  18.    31             #include <stdlib.h>
  19.   158             #include <stdio.h>
  20.   417             #include <string.h>
  21.   521             #include <ctype.h>
  22.   586             #include <rmxc.h>
  23.  2636             
  24.  2637             /*  Forward declarations */
  25.  2638             extern void delay_fine();
  26.  2639             extern void delay();
  27.  2640             
  28.  2641             /**********************************************************************/
  29.  2642             /*  C_DATA                                                            */
  30.  2643             /**********************************************************************/
  31.  2644             void c_data()
  32.  2645             {
  33.  2646     1           char            array1[12];
  34.  2647     1           int             i;
  35.  2648     1       
  36.  2649     1           struct struc1_type {
  37.  2650     1               char            xchar;
  38.  2651     1               short int       xshort;
  39.  2652     1               int             xint;
  40.  2653     1               unsigned int    xunint;
  41.  2654     1           } struc1;
  42.  2655     1       
  43.  2656     1           struct customertype {
  44.  2657     1               char                    name[8];
  45.  2658     1               char                    phone[7];   
  46.  2659     1               struct  customertype    *linkfor;
  47.  2660     1           } customerlist[3];
  48.  2661     1           
  49.  2662     1           struct customertype *customer,*oldcust;
  50.  2663     1       
  51.  2664     1           static char *name_init[3] = {
  52.  2665     1                        "Beth    ",
  53.  2666     1                        "Steve   ",
  54.  2667     1                        "Becky   "
  55.  2668     1           };
  56.  2669     1       
  57.  2670     1           static char *phone_init[3] = {
  58.  2671     1                       "5551234",
  59.  2672     1                       "5555678",
  60.  2673     1                       "5554321"
  61. iC-386  COMPILER   CUTILS                                                                    09/05/90 12:11:31  PAGE   2
  62.  
  63.  
  64.  2674     1           };
  65.  2675     1           /*  Format for a simple (unreal) Ethernet packet
  66.  2676     1       
  67.  2677     1           +----------------------------------------------------+
  68.  2678     1           | P | Dest  | Source | Type |  Data            | CRC |
  69.  2679     1           +----------------------------------------------------+
  70.  2680     1           31  28      24       20     17                 1     0
  71.  2681     1           */
  72.  2682     1       
  73.  2683     1           struct enet_pkt_type {
  74.  2684     1               unsigned int    crc:2;
  75.  2685     1               unsigned int    data:16;
  76.  2686     1               unsigned int    pkt_type:3;
  77.  2687     1               unsigned int    source_addr:4;
  78.  2688     1               unsigned int    dest_addr:4;
  79.  2689     1               unsigned int    preamble:3;
  80.  2690     1           } enet_pkt;
  81.  2691     1       
  82.  2692     1           for( i = 0 ; i <= 11 ; i++ )
  83.  2693     1               array1[i]= (char)i + ' ';
  84.  2694     1           
  85.  2695     1           struc1.xchar     = '!';
  86.  2696     1           struc1.xshort    = -10;
  87.  2697     1           struc1.xint      = 1;
  88.  2698     1           struc1.xunint    = 6;
  89.  2699     1           
  90.  2700     1           enet_pkt.data = 4096;
  91.  2701     1           enet_pkt.crc = 1;
  92.  2702     1           enet_pkt.pkt_type = 3;
  93.  2703     1           enet_pkt.source_addr = 10;
  94.  2704     1           enet_pkt.dest_addr = 12;
  95.  2705     1           enet_pkt.preamble = 7;
  96.  2706     1           
  97.  2707     1           customer = NULL;
  98.  2708     1           for(i=0;i<=2;i++){
  99.  2709     2               oldcust = customer;
  100.  2710     2               customer = &customerlist[i];
  101.  2711     2               strcpy(customerlist[i].name,name_init[i]);
  102.  2712     2               strcpy(customerlist[i].phone,phone_init[i]);
  103.  2713     2               customer->linkfor = NULL;
  104.  2714     2               if (oldcust != NULL)
  105.  2715     2                   oldcust->linkfor = customer;
  106.  2716     2           }
  107.  2717     1       }
  108.  2718             
  109.  2719             
  110.  2720             void delay (msecs)
  111.  2721             int msecs;
  112.  2722             {
  113.  2723     1           int     sleep100;           /*  Each unit of "sleep100" is 100 msecs.    */
  114.  2724     1       
  115.  2725     1           sleep100 = msecs / 100;
  116.  2726     1       
  117.  2727     1           for (; sleep100 >= 0; sleep100--)
  118.  2728     1               delay_fine (10);        /*  delay_fine(10) delays for 100 msecs.     */
  119.  2729     1       }
  120.  2730             
  121. iC-386  COMPILER   CUTILS                                                                    09/05/90 12:11:31  PAGE   3
  122.  
  123.  
  124.  2731             
  125.  2732             static void delay_fine (count)
  126.  2733             int count;
  127.  2734             {
  128.  2735     1           WORD        exception;
  129.  2736     1       
  130.  2737     1           if (count != 0) {
  131.  2738     2               rqsleep (1, &exception);    /*  One rqsleep unit is 10 msecs. */
  132.  2739     2               delay_fine (--count );      /*  Call self recursively.        */
  133.  2740     2           }
  134.  2741     1       }
  135.  
  136.  
  137.  
  138. MODULE INFORMATION:
  139.  
  140.      CODE AREA SIZE               = 000001F3H         499D
  141.      CONSTANT AREA SIZE           = 00000033H          51D
  142.      DATA AREA SIZE               = 00000024H          36D
  143.      MAXIMUM STACK SIZE           = 0000008CH         140D
  144.  
  145. iC-386 COMPILATION COMPLETE.      0 REMARKS,     0 WARNINGS,     0 ERRORS
  146.