From 0ae55ef46682f223dc307da6bd0c7a66a944e5cc Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Fri, 13 Dec 2024 16:38:56 +0100 Subject: [PATCH] fix label address --- src/Assembleur.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Assembleur.cpp b/src/Assembleur.cpp index 8eb759d..e0304ed 100644 --- a/src/Assembleur.cpp +++ b/src/Assembleur.cpp @@ -69,7 +69,8 @@ std::uint32_t Assembleur::ParseLabel(const std::string& a_Label) { throw std::invalid_argument("Label " + a_Label + " not found !"); } - return it->second; + // the address starts at 0, not 1 + return it->second - 1; } void Assembleur::AddLabel(const std::string& a_Label, std::uint32_t a_Line) {