From 093e21db45f6b2a976adf1ffe329d75f504449b6 Mon Sep 17 00:00:00 2001 From: zombie Date: Sat, 18 Sep 2021 06:31:46 -0400 Subject: [PATCH] diff now works --- diff.asm | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/diff.asm b/diff.asm index e50da93..941bcfe 100644 --- a/diff.asm +++ b/diff.asm @@ -6,8 +6,8 @@ extern puts section .data - text db "rEE",0 - text2 db "REEE",0 + text db "REEEEEEEEEE",0 + text2 db "REEEEEEErEE",0 differ db "they differ",0 notdiffer db "they do not differ",0 textlength dq 0 @@ -37,6 +37,36 @@ main: jne _differ + + xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before) +_loop: +;loop tings + + mov r8, text + add r8, rcx + + mov r9, text2 + add r9, rcx + + mov r10b, [r8] + mov r11b, [r9] + + + + cmp r10b, r11b + jne _differ + cmp r10b, 0 + je _notdiffer + cmp r11b, 0 + je _notdiffer + + + + inc rcx + jmp _loop + + + _differ: mov rdi, differ