From 53f9c1e2f7bf122bcb16acadee046282553b17d2 Mon Sep 17 00:00:00 2001 From: Kwarde Date: Tue, 15 Jul 2025 16:50:00 +0200 Subject: [PATCH] Fix tests for printf %p: Don't use random magic number but actual pointers, since that's what %p is for) --- src/tests.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests.asm b/src/tests.asm index 76427a3..d0ca6d1 100644 --- a/src/tests.asm +++ b/src/tests.asm @@ -101,7 +101,7 @@ section .rodata printf13Str db "%o | %8o | %08o\n",EOS printf14 db TAB,"printf(",DQUO,"%#b | %#08b | %#x | %#8X | %#o\n",DQUO,", 8, 8, 0xABCDEF, 0x12345678, 15): ",NL,TAB,TAB,EOS printf14Str db "%#b | %#08b | %#x | %#8X | %#o\n",EOS - printf15 db TAB,"printf(",DQUO,"%p | %#p | %8p | %08p | %#08p\n",DQUO,", 0xabc, 0xabc, 0xabc, 0xabc, 0xabc): ",NL,TAB,TAB,EOS + printf15 db TAB,"printf(",DQUO,"%p | %#p | %8p | %08p | %#08p\n",DQUO,", str5, str5, str5, strBuff1, strBuff1): ",NL,TAB,TAB,EOS printf15Str db "%p | %#p | %8p | %08p | %#08p\n",EOS ; strlen() msgStrlen db NL,"TEST strlen()",NL,EOS @@ -402,11 +402,11 @@ _start: lea rdi, [rel printf15] call print lea rdi, [rel printf15Str] - mov rsi, 0xabc - mov rdx, 0xabc - mov rcx, 0xabc - mov r8, 0xabc - mov r9, 0xabc + lea rsi, [rel str5] + lea rdx, [rel str5] + lea rcx, [rel str5] + lea r8, [rel strBuff1] + lea r9, [rel strBuff1] call printf %endif