made it more system v complient

in diff i use fucking r10b for somereason
This commit is contained in:
zombie maniac 2021-09-24 17:33:36 -04:00
parent 4ae491bdb5
commit d8f9936073
6 changed files with 17 additions and 16 deletions

View file

@ -1,6 +1,7 @@
extern puts extern puts
%include "../inc/case_func.inc" %include "../inc/case_func.inc"
global case_func
section .data section .data
text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0 text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0
@ -10,7 +11,7 @@ section .text
main: main:
sub rsp, 8 ;enter sub rsp, 8 ;enter
mov r8, text mov rdi, text
call case_func call case_func
mov rdi, text mov rdi, text

View file

@ -13,11 +13,11 @@ section .text
main: main:
sub rsp, 8 ;enter sub rsp, 8 ;enter
mov r8, text mov rdi, text
mov r9, text2 mov rsi, text2
call diff_func call diff_func
cmp r10b, 0 cmp r10b, 1 ;why tf did i make ut r10b as the return like tf?!?!?!?
jz _notdiffer jz _notdiffer

View file

@ -1,7 +1,7 @@
%include "../inc/length_func.inc" %include "../inc/length_func.inc"
case_func: case_func:
mov r11, r8 mov r11, rdi
;length_funcx accepts r8 ;length_funcx accepts r8
call length_func call length_func

View file

@ -4,11 +4,11 @@ diff_func:
_loopwasp12bsharknado: _loopwasp12bsharknado:
;loop tings ;loop tings
add r8, rcx add rdi, rcx
add r9, rcx add rsi, rcx
mov r10b, [r8] mov r10b, [rdi]
mov r11b, [r9] mov r11b, [rsi]

View file

@ -1,17 +1,17 @@
length_func: length_func:
mov r10, r8 mov r10, rdi
_loop67865432: _loop67865432:
mov r9b, [r8] mov r9b, [rdi]
cmp r9b, 0 cmp r9b, 0
jz _exitloop4323567 jz _exitloop4323567
inc r8 inc rdi
jmp _loop67865432 jmp _loop67865432
_exitloop4323567: _exitloop4323567:
sub r8, r10 sub rdi, r10
mov rax, r8 mov rax, rdi
ret ret

View file

@ -20,7 +20,7 @@ main:
mov r8, text mov rdi, text
call length_func call length_func
mov [testasd], rax mov [testasd], rax