From 43b170ea0375e829cf5208a88ab9705aa4be413d Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 8 Jul 2018 22:57:50 -0700 Subject: 4330 - start allocating data/stack/heap segments ex4 now writes to the (global) data segment, rather than trying to write to the code segment. We still need to specify the other segments in the generated ELF, though. --- subx/021translate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subx/021translate.cc') diff --git a/subx/021translate.cc b/subx/021translate.cc index 5757805e..c32b8fef 100644 --- a/subx/021translate.cc +++ b/subx/021translate.cc @@ -34,7 +34,7 @@ void perform_all_transforms(string& program) { // write out the current Memory contents from address 1 to End_of_program to a // bare-bones ELF file with a single section/segment and a hard-coded origin address. void dump_elf(const string& program, const char* filename) { - Mem.resize(1024); + initialize_mem(); // load program into memory, filtering out comments load_program(program, 1); // Not where 'program' should be loaded for running. // But we're not going to run it right now, so we -- cgit 1.4.1-2-gfad0