diff options
Diffstat (limited to '')
-rw-r--r-- | asm/c_args.asm | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/asm/c_args.asm b/asm/c_args.asm deleted file mode 100644 index 17f90c9..0000000 --- a/asm/c_args.asm +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************************/ -/* */ -/* File : c_args.asm /_________/ */ -/* Author : Joe | */ -/* Date : 04/2020 | */ -/* Info : Check args | */ -/* / | */ -/* \ / */ -/* \_____/ */ -/* */ -/****************************************************************************************/ - -/***********************************/ -/* c_args(argc: rdi, *argv[]: rsi) */ -/* ------------------------------- */ -/* returns 0 if args are invalid */ -/* returns 1 if args are valid */ -/***********************************/ - -.text -.extern strncmp -.globl c_args - -c_args: - cmp $0x2, %rdi - jle no_args - xorq %rax, %rax - pushq %rcx - xorq %rcx, %rcx - movb $0x8, %cl - movq (%rsi, %rcx, 2), %rax - cmpb $0x0, (%rax) - je no_args - pushq %rdi - movq (%rsi, %rcx, 1), %rdi - pushq %rsi - movq $reference, %rsi - pushq %rdx - xorq %rdx, %rdx - movb $0x6, %dl - callq strncmp - popq %rdx - popq %rsi - popq %rdi - popq %rcx - cmp $0x0, %rax - jne no_args - xorq %rax, %rax - movb $0x1, %al - jmp return - -no_args: - xorq %rax, %rax - -return: - retq - -.data - reference: .asciz "--say" |