/* * boot.c: Main program for CSE 582 compiled code * Ruth Anderson & Hal Perkins 8/11/99, 10/31/02 * * Contents: Standard get and put functions plus * main program that calls compiled code as a functions * Add additional functions to allocate storage for * objects and any other operations desired */ #include #include extern int asm_main(); /* main function in compiled code */ /* change function name if your */ /* compiled main has a different label */ /* * Prompt for input, then return * next integer from standard input. */ int get() { int k; printf("get: "); scanf("%d", &k); return k; } /* Write x to standard output with a title */ void put(int x) { printf("put: %d\n", x); } /* * jfmalloc returns a pointer to a chunk of memory * at least num_bytes large. Returns NULL if there * is insufficient memory available. */ void* jfmalloc(int num_bytes) { return (malloc(num_bytes)); } /* Execute compiled program asm_main */ void main() { asm_main(); }