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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:06:22+00:00 2026-05-19T04:06:22+00:00

As part of an assignment, I’m supposed to write to a file using system

  • 0

As part of an assignment, I’m supposed to write to a file using system calls. Everything works fine except when I try to open the file in gedit (Linux). It says it can’t identify the character encoding. Notepad (on Windows) opens the file just fine.

Why doesn’t this work on Linux ?

Here’s the code:

    section .text

    global _start

        _start:
                    mov EAX, 8
                    mov EBX, filename
                    mov ECX, 0700
                    int 0x80
                    mov EBX, EAX
                    mov EAX, 4
                    mov ECX, text
                    mov EDX, textlen
                    int 0x80
                    mov EAX, 6
                    int 0x80
                    mov eax, 1
                    int 0x80
        
    section .data

        filename db "./output.txt", 0
        text db "hello world", 0
        textlen equ $ - text

— update: adding a linefeed character after the output string fixed it.

  • 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-19T04:06:23+00:00Added an answer on May 19, 2026 at 4:06 am

    fixed it, see update in the question.

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

Sidebar

Related Questions

For a database assignment I have to model a system for a school. Part
I have an assignment in a language-independent class, and part of it is using
Part of my latest webapp needs to write to file a fair amount as
As a part of an assignment, I need to write two functions: a function
Im having a problem with a final part of my assignment. We get in
I have as part of assignment to look into a development kit that uses
For a homework assignment in linear algebra, I have solved the following equation using
As part of an assignment, I have to create a component diagram for existing
I am writing my own shell as part of course assignment. So I need
Hi I am new to Python and as a part of my assignment I

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.