2021-09-15 09:22:20 -04:00
|
|
|
extern puts
|
2021-10-02 13:33:46 -04:00
|
|
|
extern libz_tolower
|
2021-09-24 17:33:36 -04:00
|
|
|
|
2021-09-18 06:35:54 -04:00
|
|
|
|
2021-09-15 09:22:20 -04:00
|
|
|
section .data
|
2021-10-02 08:30:17 -04:00
|
|
|
tempstore db 0
|
|
|
|
argument_error db "Argument Error!... either too many args or too little please fix", 0
|
2021-09-15 09:22:20 -04:00
|
|
|
section .text
|
|
|
|
global main
|
|
|
|
|
|
|
|
main:
|
2021-09-15 10:15:54 -04:00
|
|
|
sub rsp, 8 ;enter
|
2021-09-15 09:22:20 -04:00
|
|
|
|
2021-10-02 08:30:17 -04:00
|
|
|
cmp rdi, 2
|
|
|
|
jne _argument_error ;if its not exactly 2 then exit
|
|
|
|
|
|
|
|
|
|
|
|
add rsi, 8 ;get the second argument because the first argument is the path
|
|
|
|
mov r8, [rsi] ;this block here fenagles the pointer into memeory instead of a register
|
2021-11-27 04:43:03 -05:00
|
|
|
mov rdi, r8 ; i also really with i had the abilty to mov [thing1], [thing2]
|
2021-10-02 08:30:17 -04:00
|
|
|
|
|
|
|
|
2021-10-02 13:33:46 -04:00
|
|
|
call libz_tolower ;libz_tolower modifies the text you send it
|
2021-10-02 08:30:17 -04:00
|
|
|
|
2021-11-27 04:43:03 -05:00
|
|
|
mov rdi, rax
|
2021-09-15 09:22:20 -04:00
|
|
|
cld
|
2021-09-15 10:15:54 -04:00
|
|
|
call puts ;this is the puts way of printing a string
|
2021-09-15 09:22:20 -04:00
|
|
|
|
|
|
|
_end:
|
2021-09-15 10:15:54 -04:00
|
|
|
add rsp, 8 ;exit
|
2021-09-15 09:22:20 -04:00
|
|
|
ret
|
2021-10-02 08:30:17 -04:00
|
|
|
|
|
|
|
_argument_error:
|
|
|
|
mov rdi, argument_error
|
|
|
|
cld
|
|
|
|
call puts
|
|
|
|
|
|
|
|
jmp _end
|