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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:21:17+00:00 2026-05-26T22:21:17+00:00

I hope these questions is rather simple: (NASM Compiler, Linux, x86 Intel Syntax) PART

  • 0

I hope these questions is rather simple: (NASM Compiler, Linux, x86 Intel Syntax)

PART 1:

I am trying to figure out how to use the .bss section of an Assembly program to find a way to store values, like a value from an operation (+ – * /), to an declared variable. For example:

section .bss

variable:  resb 50                                       ;Imaginary buffer

section .text

add 10,1                                                 ;Operation
;move the result into variable

So, I know it is possible to do this with the kernel intterupt for reading user input (but that involves strings, but is there a way to copy this value into the variable variable so that it can be used later? This would be much easier than having to push and pop two things on and off the stack.

PART 2:

Is there a way to remove the value of the variable in the .bss section? In other words, if I want to store a new value in the .bss variable, how could I do it without the characters/values already in the variable not getting compounded with the new value(s)?

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-26T22:21:17+00:00Added an answer on May 26, 2026 at 10:21 pm
    section .bss
    
    variable: resb 4
    

    … the symbol variable now refers to the address of 4 bytes of storage in the .bss section (i.e. enough to store a 32-bit value in).

    section .text
    ...
    mov eax, 123
    mov [variable], eax
    

    … sets the eax register to 123, and then stores the value of eax in the location addressed by the symbol variable.

    mov eax, [variable]
    

    … reads the value currently stored in the location addressed by variable into the eax register.

    mov eax, 456
    mov [variable], eax
    

    … stores a new value, overwriting the previous one.

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

Sidebar

Related Questions

I wanna make this rather simple to ask so I can hope for a
I downloaded these zip files from the link http://netbeans.org/downloads/zip.html with the hope that this
Given file names like these: /the/path/foo.txt bar.txt I hope to get: foo bar Why
I hope there's a simple solution for this: I have a table where each
i'm trying to do the following hope there's a reg_ex expert around to shed
I hope someone out there can shed some light on the topic of creating
Hey everyone, this seems like it should be a simple one; I really hope
I hope I'm wording my question properly, but what I'm trying to do is
I hope this isn't a dumb question, as I am rather new to Android,
This is part question, and part hope for confirmation. I have my suspicions about

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.