home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / challenge / 12.09-Sep96 / Testcode96.09R1.sit.hqx / Testcode96.09R1 / JavaMiniVM.c < prev    next >
C/C++ Source or Header  |  1996-08-14  |  2KB  |  35 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. void JavaMiniVM(
  5.     void *constant_pool,        /* pointer to cp_info array */
  6.     void *fields,                        /* pointer to field_info array */
  7.     void *methods,                        /* pointer to method_info array */
  8.     void *classFile,                /* pointer to class file */
  9.     long methodToExecute,    /* index of method to start executing */
  10.     void *heapSpace,                /* preallocated storage for your use */
  11.     void *returnStack                /* stack where return values are stored */
  12. );
  13.  
  14. void JavaMiniVM(
  15.     void *constant_pool,        /* pointer to cp_info array */
  16.     void *fields,                        /* pointer to field_info array */
  17.     void *methods,                        /* pointer to method_info array */
  18.     void *classFile,                /* pointer to class file */
  19.     long methodToExecute,    /* index of method to start executing */
  20.     void *heapSpace,                /* preallocated storage for your use */
  21.     void *returnStack                /* stack where return values are stored */
  22. ) {
  23. /* 
  24.  *Replace the following with your code
  25.  */
  26.     printf("constant pool ptr=%lx contents=%lx %lx %lx %lx\n",
  27.         constant_pool,*(long *)constant_pool,*(1+(long *)constant_pool),*(2+(long *)constant_pool),*(3+(long *)constant_pool));
  28.     printf("fields ptr=%lx contents=%lx %lx %lx %lx\n",
  29.         fields,*(long *)fields,*(1+(long *)fields),*(2+(long *)fields),*(3+(long *)fields));
  30.     printf("methods ptr=%lx contents=%lx %lx %lx %lx\n",
  31.         methods,*(long *)methods,*(1+(long *)methods),*(2+(long *)methods),*(3+(long *)methods));
  32.     printf("class file=%lx contents=%lx %lx %lx %lx\n",
  33.         classFile,*(long *)classFile,*(1+(long *)classFile),*(2+(long *)classFile),*(3+(long *)classFile));
  34.     printf("method to execute = %ld\n\n",methodToExecute);
  35. }