fixed it it now works :)
This commit is contained in:
parent
8f228059c0
commit
176cb33c18
4 changed files with 24 additions and 9 deletions
5
case.asm
5
case.asm
|
@ -1,10 +1,9 @@
|
||||||
extern length_func
|
extern length_func
|
||||||
|
|
||||||
|
global _case_func
|
||||||
section .text
|
section .text
|
||||||
global tolower
|
|
||||||
|
|
||||||
tolower:
|
_case_func:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
||||||
mov r11, rdi
|
mov r11, rdi
|
||||||
|
|
9
diff.asm
9
diff.asm
|
@ -1,13 +1,20 @@
|
||||||
|
global diff_func
|
||||||
section .text
|
section .text
|
||||||
global diff_func
|
|
||||||
|
|
||||||
diff_func:
|
diff_func:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
||||||
xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before)
|
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:
|
_loopwasp12bsharknado:
|
||||||
;loop tings
|
;loop tings
|
||||||
|
|
||||||
|
mov rdi, r8
|
||||||
|
mov rsi, r9
|
||||||
|
|
||||||
add rdi, rcx
|
add rdi, rcx
|
||||||
add rsi, rcx
|
add rsi, rcx
|
||||||
|
|
||||||
|
|
17
example.asm
17
example.asm
|
@ -1,11 +1,13 @@
|
||||||
extern puts
|
extern puts
|
||||||
extern length_func
|
extern length_func
|
||||||
extern tolower
|
extern _case_func
|
||||||
extern diff_func
|
extern diff_func
|
||||||
|
|
||||||
section .data
|
section .data
|
||||||
text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0
|
text2 db 0,0
|
||||||
text2 db "reee",0
|
text db 0,0,0
|
||||||
|
|
||||||
|
|
||||||
stoer db "0",0
|
stoer db "0",0
|
||||||
differ db "they differ",0
|
differ db "they differ",0
|
||||||
notdiffer db "they dont differ",0
|
notdiffer db "they dont differ",0
|
||||||
|
@ -16,13 +18,20 @@ main:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
||||||
mov rdi, text
|
mov rdi, text
|
||||||
call tolower
|
call _case_func
|
||||||
|
|
||||||
mov rdi, text
|
mov rdi, text
|
||||||
cld
|
cld
|
||||||
call puts ;this is the puts way of printing a string
|
call puts ;this is the puts way of printing a string
|
||||||
|
|
||||||
|
|
||||||
|
mov rdi, text2
|
||||||
|
cld
|
||||||
|
call puts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mov rdi, text2
|
mov rdi, text2
|
||||||
call length_func
|
call length_func
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
global length_func
|
||||||
section .data
|
section .data
|
||||||
testasd dq 0
|
testasd dq 0
|
||||||
section .text
|
section .text
|
||||||
global length_func
|
|
||||||
|
|
||||||
length_func:
|
length_func:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
Loading…
Reference in a new issue