asmsh/asmsh.s
2023-02-10 14:12:58 +01:00

60 lines
976 B
ArmAsm

.file "asmsh.c"
.text
.section .rodata
.LC0:
.string "Unable to fork :"
.text
.globl main
.type main, @function
main:
.LFB6:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movq %rsi, -32(%rbp)
call fork@PLT
movl %eax, -4(%rbp)
cmpl $0, -4(%rbp)
jns .L2
leaq .LC0(%rip), %rdi
call perror@PLT
movl $1, %eax
jmp .L3
.L2:
cmpl $0, -4(%rbp)
jne .L4
movl $0, %eax
call child_process
.L4:
movl $0, %eax
.L3:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size main, .-main
.globl child_process
.type child_process, @function
child_process:
.LFB7:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE7:
.size child_process, .-child_process
.ident "GCC: (Debian 10.2.1-6) 10.2.1 20210110"
.section .note.GNU-stack,"",@progbits