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
/
Testcode96.09R1
/
JavaMiniVM.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-08-14
|
2KB
|
35 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void JavaMiniVM(
void *constant_pool, /* pointer to cp_info array */
void *fields, /* pointer to field_info array */
void *methods, /* pointer to method_info array */
void *classFile, /* pointer to class file */
long methodToExecute, /* index of method to start executing */
void *heapSpace, /* preallocated storage for your use */
void *returnStack /* stack where return values are stored */
);
void JavaMiniVM(
void *constant_pool, /* pointer to cp_info array */
void *fields, /* pointer to field_info array */
void *methods, /* pointer to method_info array */
void *classFile, /* pointer to class file */
long methodToExecute, /* index of method to start executing */
void *heapSpace, /* preallocated storage for your use */
void *returnStack /* stack where return values are stored */
) {
/*
*Replace the following with your code
*/
printf("constant pool ptr=%lx contents=%lx %lx %lx %lx\n",
constant_pool,*(long *)constant_pool,*(1+(long *)constant_pool),*(2+(long *)constant_pool),*(3+(long *)constant_pool));
printf("fields ptr=%lx contents=%lx %lx %lx %lx\n",
fields,*(long *)fields,*(1+(long *)fields),*(2+(long *)fields),*(3+(long *)fields));
printf("methods ptr=%lx contents=%lx %lx %lx %lx\n",
methods,*(long *)methods,*(1+(long *)methods),*(2+(long *)methods),*(3+(long *)methods));
printf("class file=%lx contents=%lx %lx %lx %lx\n",
classFile,*(long *)classFile,*(1+(long *)classFile),*(2+(long *)classFile),*(3+(long *)classFile));
printf("method to execute = %ld\n\n",methodToExecute);
}