From 015f460d7fd19b735afc6c0d863a394331848d6c Mon Sep 17 00:00:00 2001 From: zombie Date: Sun, 19 Sep 2021 12:20:15 -0400 Subject: [PATCH] removed length code from differ after galaxy brianing i realize i dont need to check the length of the strings because if it compares a character with another from another string and one is a zero we have reached the end of the string and we arnt reading memory that isnt ours --- diff.asm | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/diff.asm b/diff.asm index 941bcfe..69da75b 100644 --- a/diff.asm +++ b/diff.asm @@ -1,9 +1,4 @@ extern puts -%include "../inc/length_func.inc" - - - - section .data text db "REEEEEEEEEE",0 @@ -19,25 +14,6 @@ main: sub rsp, 8 ;enter -;below we are getting the length of each string -;we do this because we dont want to compare with memory that isnt ours - - mov r8, text - call length_func - mov [textlength], rax - - mov r8, text2 - call length_func - mov [text2length], rax - - mov r8, [textlength] - mov r9, [text2length] - - cmp r8, r9 - jne _differ - - - xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before) _loop: ;loop tings