diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/c_bsdsetsid.S | 50 | ||||
-rw-r--r-- | src/u_print.S | 22 | ||||
-rw-r--r-- | src/u_strlen.S | 6 |
3 files changed, 39 insertions, 39 deletions
diff --git a/src/c_bsdsetsid.S b/src/c_bsdsetsid.S index 17cf57b..de55b7f 100644 --- a/src/c_bsdsetsid.S +++ b/src/c_bsdsetsid.S @@ -7,39 +7,39 @@ main: cmpb $0x1, %dil jle c_noarg - pushq %rdi - pushq %rsi - pushq %rdx - xorq %rcx, %rcx - movq (%rsi, %rcx, 8), %rdi - movq %rcx, %r8 - callq u_pout - movq %r8, %rcx - popq %rdx - popq %rsi - popq %rdi - pushq %rdi - pushq %rsi - pushq %rdx + push %rdi + push %rsi + push %rdx + xor %rcx, %rcx + mov (%rsi, %rcx, 8), %rdi + mov %rcx, %r8 + call u_pout + mov %r8, %rcx + pop %rdx + pop %rsi + pop %rdi + push %rdi + push %rsi + push %rdx inc %rcx - movq (%rsi, %rcx, 8), %rdi - callq u_pout - popq %rdx - popq %rsi - popq %rdi + mov (%rsi, %rcx, 8), %rdi + call u_pout + pop %rdx + pop %rsi + pop %rdi jmp c_exit c_noarg: - leaq noarg_str, %rdi - callq u_perr - movq $0x1, %rdi - xorq %rax, %rax + lea noarg_str, %rdi + call u_perr + mov $0x1, %rdi + xor %rax, %rax movb $0x1, %al # SYS_exit syscall c_exit: - xorq %rdi, %rdi - xorq %rax, %rax + xor %rdi, %rdi + xor %rax, %rax movb $0x1, %al # SYS_exit syscall diff --git a/src/u_print.S b/src/u_print.S index 3866868..47a9483 100644 --- a/src/u_print.S +++ b/src/u_print.S @@ -4,25 +4,25 @@ .globl u_perr u_pout: - movq $0x1, %r11 # stdout + mov $0x1, %r11 # stdout jmp u_print u_perr: - movq $0x2, %r11 # stderr + mov $0x2, %r11 # stderr jmp u_print u_print: - callq u_strlen - movq %rax, %rdx - movq %rdi, %rsi - movq %r11, %rdi - movq $0x4, %rax # SYS_write + call u_strlen + mov %rax, %rdx + mov %rdi, %rsi + mov %r11, %rdi + mov $0x4, %rax # SYS_write syscall - leaq nl, %rsi - movq $0x1, %rdx - movq $0x4, %rax # SYS_write + lea nl, %rsi + mov $0x1, %rdx + mov $0x4, %rax # SYS_write syscall - retq + ret .data nl: .asciz "\n" diff --git a/src/u_strlen.S b/src/u_strlen.S index 27d9663..b1e2447 100644 --- a/src/u_strlen.S +++ b/src/u_strlen.S @@ -2,7 +2,7 @@ .globl u_strlen u_strlen: - movq %rdi, %rcx + mov %rdi, %rcx u_loop: cmpb $0x0, (%rcx) @@ -12,5 +12,5 @@ u_loop: u_ret: sub %rdi, %rcx - movq %rcx, %rax - retq + mov %rcx, %rax + ret |