annotate gen.c @ 989:d70000fdff0b

Implemented IR and undefined bits of info word for address error exception frames
author Michael Pavone <pavone@retrodev.com>
date Wed, 27 Apr 2016 21:39:17 -0700
parents a7774fc2de4b
children
rev   line source
pavone@563 1 #include <stdio.h>
pavone@563 2 #include <stdlib.h>
pavone@563 3 #include "gen.h"
pavone@563 4 #include "mem.h"
pavone@792 5 #include "util.h"
pavone@563 6
pavone@563 7 void init_code_info(code_info *code)
pavone@563 8 {
pavone@563 9 size_t size = CODE_ALLOC_SIZE;
pavone@563 10 code->cur = alloc_code(&size);
pavone@563 11 if (!code->cur) {
pavone@792 12 fatal_error("Failed to allocate memory for generated code\n");
pavone@563 13 }
pavone@563 14 code->last = code->cur + size/sizeof(code_word) - RESERVE_WORDS;
pavone@894 15 code->stack_off = 0;
pavone@563 16 }