langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
32
Task/Fork/X86-Assembly/fork.x86
Normal file
32
Task/Fork/X86-Assembly/fork.x86
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
extern fork
|
||||
extern printf
|
||||
|
||||
section .text
|
||||
global _start
|
||||
|
||||
_start:
|
||||
call fork
|
||||
cmp eax, 0
|
||||
je _child
|
||||
jg _parent
|
||||
jmp _exit
|
||||
|
||||
_parent:
|
||||
push p_msg
|
||||
call printf
|
||||
jmp _exit
|
||||
_child:
|
||||
push c_msg
|
||||
call printf
|
||||
jmp _exit
|
||||
|
||||
_exit:
|
||||
push 0x1
|
||||
mov eax, 1
|
||||
push eax
|
||||
int 0x80
|
||||
ret
|
||||
|
||||
section .data
|
||||
c_msg db "Printed from Child process",13,10,0
|
||||
p_msg db "Printed from Parent process",13,10,0
|
||||
Loading…
Add table
Add a link
Reference in a new issue