diff --git a/case.asm b/case.asm index 27fe7a9..2a53ee3 100644 --- a/case.asm +++ b/case.asm @@ -1,10 +1,9 @@ extern length_func - +global _case_func section .text - global tolower -tolower: +_case_func: sub rsp, 8 ;enter mov r11, rdi diff --git a/diff.asm b/diff.asm index d14383d..8f40526 100644 --- a/diff.asm +++ b/diff.asm @@ -1,13 +1,20 @@ +global diff_func section .text - global diff_func diff_func: sub rsp, 8 ;enter xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before) + + mov r8, rdi ;dupe them + mov r9, rsi + _loopwasp12bsharknado: ;loop tings + mov rdi, r8 + mov rsi, r9 + add rdi, rcx add rsi, rcx diff --git a/example.asm b/example.asm index 7d277ef..1c88a06 100644 --- a/example.asm +++ b/example.asm @@ -1,11 +1,13 @@ extern puts extern length_func -extern tolower +extern _case_func extern diff_func section .data - text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0 - text2 db "reee",0 + text2 db 0,0 + text db 0,0,0 + + stoer db "0",0 differ db "they differ",0 notdiffer db "they dont differ",0 @@ -16,13 +18,20 @@ main: sub rsp, 8 ;enter mov rdi, text - call tolower + call _case_func mov rdi, text cld call puts ;this is the puts way of printing a string + mov rdi, text2 + cld + call puts + + + + mov rdi, text2 call length_func diff --git a/length.asm b/length.asm index df0249b..10dc52b 100644 --- a/length.asm +++ b/length.asm @@ -1,7 +1,7 @@ +global length_func section .data testasd dq 0 section .text - global length_func length_func: sub rsp, 8 ;enter