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 6946805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:36:45+00:00 2026-05-27T13:36:45+00:00

I am currently learning Assembly language on Linux. I have been using the book

  • 0

I am currently learning Assembly language on Linux. I have been using the book ‘Programming From the Ground Up’ and all the examples are 32-bit. My OS is 64-bit and I have been trying to do all the examples in 64-bit. I am having trouble however:

.section .data

.section .text
.global _start
_start:
movq $60, %rax
movq $2, %rbx
int $0x80

This merely just calls the Linux exit System call or it should. Instead it causes a SEG FAULT and when I instead do this

.section .data

.section .text
.global _start
_start:
movq $1, %rax
movq $2, %rbx
int $0x80

it works. Clearly the problem is the value I move to %rax. The value $1 that I use in the second example is what ‘Programming From the Ground Up’ said to use however multiple sources on the Internet have said that the 64-bit System Call Number is $60. Reference
What am I doing wrong? Also what other issues should I watch out for and what should I use for a reference? Just in case you need to know, I am on Chapter 5 in Programming From The Ground Up.

  • 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-27T13:36:46+00:00Added an answer on May 27, 2026 at 1:36 pm

    You’re running into one surprising difference between i386 and x86_64: they don’t use the same system call mechanism. The correct code is:

    movq $60, %rax
    movq $2,  %rdi   ; not %rbx!
    syscall
    

    Interrupt 0x80 always invokes 32-bit system calls. It’s used to allow 32-bit applications to run on 64-bit systems.

    For the purposes of learning, you should probably try to follow the tutorial exactly, rather than translating on the fly to 64-bit — there are a few other significant behavioral differences that you’re likely to run into. Once you’re familiar with i386, then you can pick up x86_64 separately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently in the process of learning assembly language. I'm using Gas on Linux
I'm currently learning the fascinating J programming language, but one thing I have not
I'm currently playing with ARM assembly on Linux as a learning exercise. I'm using
I'm currently learning x86 assembly with Guide to assembly language in Linux and on
I am currently learning MVVM abd the tutorial I have been using, simply uses
I'm currently learning Haskell, Which language (F# or Haskell) do you prefer for programming
I'm currently learning the network programming with C/C++... I have experience .NET but not
i'm currently learning x86 assembly language and wondered what is the better way for
I have been learning Assembly and I have a question. The textbook presents the
Im currently learning c++ from a book called 'Ivor Hortons Beginning Visual c++ 2010'.

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.