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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:20:40+00:00 2026-05-28T03:20:40+00:00

This an excerpt from my assembly program First: dw 0xaabbccdd Now I realize that

  • 0

This an excerpt from my assembly program

First: dw 0xaabbccdd

Now I realize that this is logically incorrect, and I was hoping the compiler would either spit out an error (nasm) or just create two side by side words.

Why didn’t this produce an error, and why did this just truncate the first half of the double word? In other words in little endian, this printed in memory going towards higher addresses 0xdd 0xcc. This would make sense if I had wrote First: dw 0xccdd, but not for what I have written. Thanks in advance :-).

  • 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-28T03:20:41+00:00Added an answer on May 28, 2026 at 3:20 am

    The assembler is correct.
    The literal value is 32 bits long, but the conversion to dw truncates the value to the 16 least significant bits: 0xaabbccdd will get truncated to 0xccdd.

    Little-endian format means the value is always stored LSB first, regardless of whether the value is 16 bits or 32 bits. So…

    • 0xccdd will be stored in memory as 0xdd 0xcc
    • 0xaabbccdd will be stored in memory as 0xdd 0xcc 0xbb 0xaa

    Hence it makes no difference if the value was truncated – the first two bytes in memory are the same.

    As André Laszlo points out, NASM generates a warning for this scenario.

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

Sidebar

Related Questions

Greetings! I must be seeing things. Look at this excerpt from the iPhone OS
This is an excerpt of code from a class I am working with in
This is an excerpt of some c++ code, that i'll have to explain in
I'm trying to add plugins to my program, and this looks good, except that
I am working to program (that was written by other people), this program is
I would like to add an update hook to git that prevents people from
I would like to add an update hook to git that prevents people from
I have this HTML structure (excerpt): <td> <select id=test1 class=pub_chooser> <option value=99>All Publications</option> <option
This first bit works: $my_id = 617; $post_id_7 = get_post($my_id); $title = $post_id_7->post_excerpt; echo
This seems like a newbie question except that I've been trying to wrap my

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.