38 lines
758 B
NASM
38 lines
758 B
NASM
extern puts
|
|
extern libz_tolower
|
|
|
|
|
|
section .data
|
|
tempstore db 0
|
|
argument_error db "Argument Error!... either too many args or too little please fix", 0
|
|
section .text
|
|
global main
|
|
|
|
main:
|
|
sub rsp, 8 ;enter
|
|
|
|
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
|
|
mov rdi, r8 ; i also really with i had the abilty to mov [thing1], [thing2]
|
|
|
|
|
|
call libz_tolower ;libz_tolower modifies the text you send it
|
|
|
|
mov rdi, rax
|
|
cld
|
|
call puts ;this is the puts way of printing a string
|
|
|
|
_end:
|
|
add rsp, 8 ;exit
|
|
ret
|
|
|
|
_argument_error:
|
|
mov rdi, argument_error
|
|
cld
|
|
call puts
|
|
|
|
jmp _end
|