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

  • Home
  • SEARCH
  • 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 469791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:49:11+00:00 2026-05-12T23:49:11+00:00

Im having a bit of trouble understanding the more complex system calls in assembly.

  • 0

Im having a bit of trouble understanding the more complex system calls in assembly. I wrote a exec system call and it worked great

 .bss

.text

.globl _start

_start:

#exit(0) system call

        movl $1, %rax
        movl $0, %rbx
        int $0X80

Though I am a bit insure and have not been able to find info pertaining to how you put strings in a register. So as an example I wanted to do a exec system call and it as its first parameter needs a filename to run and I want to run “/bin/bash”, but how do I get that in rbx. How do I even know that I have to use rbx, in X86 I know I would use ebx, is it the same relationship in amd64 ebx=rbx, ecx=rcs, etc.

int execve(const char *filename, char *const argv[],
char *const envp[]);

Thanks all

  • 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-12T23:49:11+00:00Added an answer on May 12, 2026 at 11:49 pm

    Here’s a trick to make progress quickly with these aspects of assembly: ask a C compiler to show you how it does it! Write a C program that does what you want to do and type gcc -S.

    Example:

    Manzana:ppc pascal$ cat t.c
    #define NULL ((void*)0)
    char *args[] = { "foo", NULL } ;
    char *env[] = { "PATH=/bin", NULL } ;
    
    
    int execve(const char *filename, char *const argv[], char *const envp[]);
    
    int main()
    {
    
      execve("/bin/bash", args, env);
    
    } 
    

    then:

    Manzana:ppc pascal$ gcc -S -fno-PIC t.c  # added no-PIC for readability of generated code
    Manzana:ppc pascal$ cat t.s
    .globl _args
        .cstring
    LC0:
        .ascii "foo\0"
        .data
        .align 2
    _args:
        .long   LC0
        .long   0
    .globl _env
        .cstring
    LC1:
        .ascii "PATH=/bin\0"
        .data
        .align 2
    _env:
        .long   LC1
        .long   0
        .cstring
    LC2:
        .ascii "/bin/bash\0"
        .text
    .globl _main
    _main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $24, %esp
        movl    $_env, 8(%esp)
        movl    $_args, 4(%esp)
        movl    $LC2, (%esp)
        call    _execve
        leave
        ret
        .subsections_via_symbols
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a little bit of trouble understanding what the problem is here. I
Having a bit of trouble with the syntax where we want to call a
I'm having a bit of trouble understanding what's going wrong with the following function:
I'm having trouble understanding the following bit of code that I was hoping would
I'm having a bit of trouble understanding the implementation of MVC in Ruby on
I'm a bit new to ASP .NET MVC and I'm having trouble understanding the
I'm having a bit of trouble with the UTL_MAIL package in Oracle 10g, and
I'm having a bit of trouble trying to get class variables to work in
I'm having a little bit of trouble making a sticky form that will remember
(vb.net/c#/etc) I am having trouble figuring out how to do a bit of deserialization

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.