From 90d67867cc06303411ef5f1212e97f6ab53b6f11 Mon Sep 17 00:00:00 2001 From: 0x4261756D Date: Sat, 23 Dec 2023 22:01:06 +0100 Subject: [PATCH] Fix fasm error when enqueueing ints > 2^32 On x64 the only instruction supporting imm64 is mov rXX, imm64 so there has to be a special case for those numbers --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 29bb828..212dd10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -501,7 +501,15 @@ fn generate_assembly_linux_x64_block(operations: &Vec, functions: &Ve { Datatype::Int => { - data.code += format!("\tmov qword [queue+8*r13], {}\n", value).as_str(); + if value.parse::().unwrap() > u32::MAX as i64 + { + data.code += format!("\tmov rax, {}\n", value).as_str(); + data.code += "\tmov qword [queue+8*r13], rax\n"; + } + else + { + data.code += format!("\tmov qword [queue+8*r13], {}\n", value).as_str(); + } } Datatype::Bool => {