Skip to content

Instantly share code, notes, and snippets.

@ichsanputr
Last active December 8, 2022 09:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Create a directory using mkdir syscall with x64 assembly linux
;compile and running using command below
;nasm -f elf64 -g -F dwarf -o a.o a.asm
;ld -o a a.o
global _start
section .data
pathDir db "dirTest",0
section .text
_start:
mov rax, 0x53 ;call mkdir syscall
mov rdi, pathDir ;pass pathDir to arg1
mov rsi, 9504
syscall
mov rax, 0x60 ;call exit syscall
mov rdi, 0 ;exit with zero status code
syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment