This commit is contained in:
2025-02-06 14:33:23 +01:00
parent 2a2313dff7
commit aaf3dfb40c
5 changed files with 203 additions and 29 deletions

View File

@@ -575,7 +575,7 @@ int secondPass(const char *source, uint8_t *code) {
// Memory reference: encode 32-bit address.
char addrStr[32];
strncpy(addrStr, srcOperand + 1, strlen(srcOperand) - 2);
addrStr[strlen(srcOperand) - 2] = '\\0';
addrStr[strlen(srcOperand) - 2] = '\0';
uint32_t memAddr = (uint32_t) strtoul(addrStr, NULL, 0);
code[addr++] = (memAddr >> 24) & 0xFF;
code[addr++] = (memAddr >> 16) & 0xFF;