WONKY



LOG | FILES | OVERVIEW


F diff --git a/src/backend/asm/intel/intel_compile.c b/src/backend/asm/intel/intel_compile.c --- a/src/backend/asm/intel/intel_compile.c +++ b/src/backend/asm/intel/intel_compile.c
}
void compile_constant_to_intel_asm(struct Compile_Data_Intel_Asm *compile_data,struct AST_Constant *constant)
{
- push_intel_asm_instruction(compile_data,get_intel_asm_simple_instruction(INTEL_ASM_OP_NOP));
+ if(constant->value->constant->type->specifier==TS_INT)
+ {
+ intel_asm_memory_location_to_rax(compile_data,get_intel_asm_in_instruction_number(*(int*)constant->value->constant->value));
+ push_intel_asm_instruction(compile_data,intel_asm_get_push(INTEL_ASM_REGISTER_RAX));
+ }else
+ {
+ intel_asm_memory_location_to_rax(compile_data,
+ reserve_static_space_for_object(compile_data,(struct Intel_Asm_Label*)get_intel_asm_new_unique_label(compile_data),get_type_size(constant->value->constant->type)));
+ push_intel_asm_instruction(compile_data,intel_asm_get_push(INTEL_ASM_REGISTER_RAX));
+ }
}
void compile_string_literal_to_intel_asm(struct Compile_Data_Intel_Asm *compile_data,struct AST_String_Literal *literal)
{