Mercurial > repos > blastem
view gen.c @ 597:8d6ae5b3b87b
Update code->cur before calling z80_get_address_trans in z80_retranslate_inst to avoid any newly translated instructions from being placed in the "buffer zone". Save the current value of the code_info struct for placing the final jmp instruction in the correct place
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 26 Dec 2014 12:52:13 -0800 |
parents | c8fefa140c80 |
children | 724bbec47f86 |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include "gen.h" #include "mem.h" void init_code_info(code_info *code) { size_t size = CODE_ALLOC_SIZE; code->cur = alloc_code(&size); if (!code->cur) { fputs("Failed to allocate memory for generated code\n", stderr); exit(1); } code->last = code->cur + size/sizeof(code_word) - RESERVE_WORDS; }