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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:43:18+00:00 2026-06-01T19:43:18+00:00

; NASM push 30 ; ‘0’ mov rax, 4 ; write mov rbx, 1

  • 0
; NASM
push 30 ; '0'

mov rax, 4 ; write
mov rbx, 1 ; stdout
mov rcx, rsp ; ptr to character on stack
mov rdx, 1 ; length of string = 1
int 80h

The code above does not print anything to stdout. It works when i give it a ptr to a character in section .data. What am i doing wrong?

  • 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-06-01T19:43:19+00:00Added an answer on June 1, 2026 at 7:43 pm

    amd64 uses a different method for system calls than int 0x80, although that might still work with 32-bit libraries installed, etc. Whereas on x86 one would do:

    mov eax, SYSCALL_NUMBER
    mov ebx, param1
    mov ecx, param2
    mov edx, param3
    int 0x80
    

    on amd64 one would instead do this:

    mov rax, SYSCALL_NUMBER_64 ; different from the x86 equivalent, usually
    mov rdi, param1
    mov rsi, param2
    mov rdx, param3
    syscall
    

    For what you want to do, consider the following example:

            bits 64
            global _start
    
    section .text
    
    _start:
            push            0x0a424242
            mov             rdx, 04h
            lea             rsi, [rsp]
            call            write
            call            exit
    exit:
            mov             rax, 60     ; exit()
            xor             rdi, rdi    ; errno
            syscall
    
    write:
            mov             rax, 1      ; write()
            mov             rdi, 1      ; stdout
            syscall
            ret
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to write something basic in assembly under Windows. I'm using NASM, but
Let's say we use NASM as they do in this answer: how to write
I am learning NASM as I write bootloaders. So far I have a hello
I write the following program in NASM in order to practice offset, addressing, tables,
Im trying to multiply two 16 bit numbers with the following NASM codes: mov
I'm using NASM 16 BITS. I'm trying to do a simple assembly code that
I have been dealing with Nasm and GNU C inline asm on a Linux
I've got a question concerning nasm and its linkage to C++. I declare a
I'm attempting to assemble some 32-bit code using NASM and GCC on a 64-bit
I have been doing some x86 programming in Windows with NASM and I have

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.