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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:40:06+00:00 2026-05-15T20:40:06+00:00

Edit: Answered my own question. See below. -_- I have a variable defined in

  • 0

Edit: Answered my own question. See below. -_-

I have a variable defined in the .data segment as follows:

retVal DW 0100h  ;stores hex fraction of the intermediate value. Starts at 1.00

This is the value that I add or subtract to to get my return value.

The first time it shows up in the code segment is at the following point:

sub [retVal], ax     ; 

I have used the debugger, and can confirm that at the time of this operation, the ax register is: 0000h.

Yet, if I add the following line of code immediately before it:

mov dx, 0100h;
mov [retVal], 0100h;

I get a completely different value (also wrong). I’m quite baffled. Am I fundamentally misusing variables here? I don’t see why loading the same value the variable was originally initialized to (and hasn’t yet been modified from) would alter the results.

Any ideas? Failing that, could someone remind me how to track the value of a variable via CodeView? (The DOSBox debugger I’m using)

  • 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-15T20:40:06+00:00Added an answer on May 15, 2026 at 8:40 pm

    Is the program in question a subroutine?

    If it is, and you call the subroutine repeatedly, are you reseting the variables you alter?

    If you do not re-declare the variables, you are not using the previously declared values the 2nd or future times you run the subroutine, but the altered values you have at the end of your first execution.

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

Sidebar

Related Questions

EDIT ~ I have answered my own question below in the EDIT section, not
EDIT: See my answer below--> I am wanting to have a view that when
Edit : This question has already been asked and answered, and I apparently am
Edit (updated question) I have a simple C program: // it is not important
edit2: Well I found out what was wrong. answered my own question. * Face-palm*
Edit 4: I was finally able to solve my own issue. See checkmark answer
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
EDIT: Simple version of the question: I want to create server variables in the
Sorry if this question has already been answered elsewhere. I looked through stack overflow
EDIT: Answer provided below. I've struggled for a couple of days to understand why

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.