Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7674263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:41:59+00:00 2026-05-31T16:41:59+00:00

I am trying to create a small assembly program to create a folder. I

  • 0

I am trying to create a small assembly program to create a folder. I looked up the system call for creating a directory on this page. It says that it is identified by 27h. How would I go about implementing the mkdir somename in assembly?

I am aware that the program should move 27 into eax but I am unsure where to go next. I have googled quite a bit and no one seems to have posted anthing about this online.

This is my current code (I don’t know in which register to put filename and so on):

section .data

section .text
global _start

mov eax, 27
mov ????????
....
int 80h

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:42:01+00:00Added an answer on May 31, 2026 at 4:42 pm

    One way of finding out, is using GCC to translate the following C code:

    #include <stdio.h>
    #include <sys/stat.h>
    
    int main()
    {
        if (mkdir("testdir", 0777) != 0)
        {
            return -1;
        }
    
        return 0;
    }
    

    to assembly, with: gcc mkdir.c -S

        .file   "mkdir.c"
        .section    .rodata
    .LC0:
        .string "testdir"
        .text
    .globl main
        .type   main, @function
    main:
    .LFB0:
        .cfi_startproc
        pushl   %ebp
        .cfi_def_cfa_offset 8
        .cfi_offset 5, -8
        movl    %esp, %ebp
        .cfi_def_cfa_register 5
        andl    $-16, %esp
        subl    $16, %esp
        movl    $511, 4(%esp)
        movl    $.LC0, (%esp)
        call    mkdir           ; interesting call
        testl   %eax, %eax
        setne   %al
        testb   %al, %al
        je  .L2
        movl    $-1, %eax
        jmp .L3
    .L2:
        movl    $0, %eax
    .L3:
        leave
        .cfi_restore 5
        .cfi_def_cfa 4, 4
        ret
        .cfi_endproc
    .LFE0:
        .size   main, .-main
        .ident  "GCC: (GNU) 4.5.1 20100924 (Red Hat 4.5.1-4)"
        .section    .note.GNU-stack,"",@progbits
    

    Anyway, ProgrammingGroundUp page 272 lists important syscalls, including mkdir:

    %eax   Name    %ebx                 %ecx       %edx    Notes
    ------------------------------------------------------------------
    39     mkdir   NULL terminated    Permission           Creates the given
                   directory name                          directory. Assumes all 
                                                           directories leading up 
                                                           to it already exist.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a small program to run on a centralized device. This
Trying to create a small monitor application that displays current internet usage as percentage
I'm trying to create a small Javascript framework that I can use in my
I'm trying to create a small application that interacts with the Product API of
I am trying to create a small function that returns the number of spaces
I'm trying to create a small web app that is used to remove items
I am trying create a small web application that allows a user to login
I'm trying to create a small application within CRM in the ISV folder. I
having a small problem. I'm trying to create a loop that will create an
I'm trying to create a small app that takes a base text template with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.