zombie-core-utils/diff.asm

57 lines
788 B
NASM
Raw Normal View History

extern puts
2021-10-02 13:33:46 -04:00
extern libz_strcmp
2021-09-19 12:44:18 -04:00
section .data
tempstore db 0
tempstore2 db 0
argument_error db "Argument Error!... either too many args or too little please fix", 0
differ db "they differ",0
notdiffer db "they do not differ",0
section .text
global main
main:
sub rsp, 8 ;enter
cmp rdi, 3
jne _argument_error
add rsi, 8
mov r8, [rsi]
mov [tempstore], r8
add rsi, 8
mov r8, [rsi]
mov [tempstore2], r8
mov rdi, [tempstore]
mov rsi, [tempstore2]
2021-10-02 13:33:46 -04:00
call libz_strcmp
2021-09-18 06:31:46 -04:00
cmp r10b, 1 ;why tf did i make ut r10b as the return like tf?!?!?!?
2021-09-19 12:44:18 -04:00
jz _notdiffer
2021-09-18 06:31:46 -04:00
2021-10-02 13:33:46 -04:00
_differ:
mov rdi, differ
cld
call puts
jmp _end
_notdiffer:
mov rdi, notdiffer
cld
call puts
_end:
add rsp, 8 ;exit
ret
2021-10-02 13:33:46 -04:00
_argument_error:
mov rdi, argument_error
cld
call puts
2021-10-02 13:33:46 -04:00
jmp _end