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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:08:49+00:00 2026-05-27T12:08:49+00:00

I am a bit confused with how variables are stored in the data segment.

  • 0

I am a bit confused with how variables are stored in the data segment. We are given this segment of code:

      .data
vala  dw  1234h
valb  db  1,2,3,4
valc  db  '1234$'
vald  db  '12'

I made an offset data table like so:

offset  00  01  02  03  04  05  06  07  08  09  10  11
data    34  12  01  02  03  04  31  32  33  34  31  32

I don’t think I am loading it into memory correctly because the total number of bytes required in memory is 13 and I only have 11 here. Can someone comment on where I went wrong?

There is another question that asks how many bytes are written to the standard output device after these instructions:

mov  dx,offset valb    ;valb has 4 bytes
mov  ah,9              ;4 bytes is written to the output
int  21h               ;for a total of 8 bytes

Am I thinking through this segment of code the right way?

  • 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-27T12:08:49+00:00Added an answer on May 27, 2026 at 12:08 pm

    You listed 12, not 11. Just count them. There’s one byte missing for the dollar character. Other than that the offsets seem fine.

    Also, function 9 only prints text, not binary numbers. It won’t print the 4 bytes (1, 2, 3 and 4) from valb in a human-readable way. How many bytes exactly it’ll print… well, it won’t print the dollar because it’s used as the string terminator (see the documentation, btw, it’s all there). So, it should be just 8 (4 weird characters for bytes 1 through 4 and characters “1”, “2”, “3” and “4”).

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

Sidebar

Related Questions

I am a bit confused why this code compiles. I leave out the necessary
I am bit confused about ADO.Net Data Services. Is it just meant for creating
I'm a bit confused over the .net redistributables... Our C# code uses some API
This is a bit confused question for those who don't now advanced SQL... However.
I'm a bit confused about the right way to write a code. I read
This should be obvious, but I'm getting a bit confused about PHP variable scope.
I'm a little bit confused now after I've seen a code snippet for iPhone
Hello i'm selfstudying C and i'm a bit confused about the following code since
I'm a bit confused about allocating memory for my variables. If e.g. I'm creating
I'm new to JS and a bit confused on this subject, I hope you'll

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.