Create a directory using mkdir syscall with x64 assembly linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;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