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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:11:11+00:00 2026-06-07T00:11:11+00:00

Was just reading about different algos disassemblers use to identify binary as assembly instructions.

  • 0

Was just reading about different algos disassemblers use to identify binary as assembly instructions. Opened a program in different disassemblers, some showed specific portions of the program as code and others showed the same portion as data. So my question is if disassemblers gets confused between opcodes being either instructions or data, how does the processor knows exactly what to do with that opcode?

I hope my question is clear..
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-06-07T00:11:12+00:00Added an answer on June 7, 2026 at 12:11 am

    The processor doesn’t know if whatever it’s asked to execute is code or data. It can be either or both at the same time. The CPU will attempt to execute whatever it’s given.

    If it fails to execute, it can generate an event such as “invalid instruction encountered” or “the memory referenced by the instruction isn’t accessible” or “division by zero” or “insufficient privileges” that the OS will (hopefully) handle. It will either fix the problem if it knows how (virtual memory is usually based on this mechanism) or let the application handle this event or terminate the application.

    There are different disassemblers. Some are “dumb” disassemblers in that they don’t try to make much or any sense of the executable file format, they will just try to disassemble whatever they are given. Others will disassemble portions of the file that are marked as code and they will start disassemblying from the entry point location (every executable has a location where its execution should be started by the OS/CPU) and use various heuristics to do sensible disassemblying.

    However, disassemblying can hardly ever be done perfectly. The main problem with correct disassemblying is that disassemblers don’t know what a piece of code will do and what it won’t do.

    For example, code can be written such that it calculates an address to jump or call to. The disassembler won’t be able to calculate such an address because, well, it doesn’t execute, emulate or interpret code. So the disassembler may be unable to figure out the next location to disassemble from.

    There are also CPUs that have variable-length instructions. This makes it possible for code to jump into the middle of an instruction. How should the disassembler disassemble that kind of code?

    Another aggravating practice is manipulation with code. Code can change itself on the fly as it executes. Code can also generate more code. Code can also be stored as data. How do you disassemble all that?

    It is therefore unsurprising that many disassemblers continue to be pretty much dumb. They just can’t compete with the brainpower of the programmers who write programs with all sorts of twists.

    EDIT:

    Also, because of that same variable-length instruction issue, disassemblying the same code starting at slightly different locations can produce different instructions.

    Example:

    Consider this byte sequence for the x86 processor in 32-bit mode: 66h,0B8h,90h,90h,90h,90h.

    If you start disassemblying it at the very first byte you will get:

    mov ax,9090h
    nop
    nop
    

    If you start disassemblying at the next byte you will get:

    mov eax,90909090h
    

    If you skip yet another byte you will get:

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

Sidebar

Related Questions

I was just reading an article about different ranking algorithms . One thing I'm
Just wondering how the world of assembly works, and I was reading about the
I only have some very rudimentary theoretical knowledge about RSA. While reading different sources
I was just reading about Magento , a free framework for easily creating an
I just finished reading about scoping in the R intro , and am very
I just starting reading about SEO and realized that I should change my GET
I was just reading abit about JMS and Apache ActiveMQ. And was wondering what
I've just been reading about MSDeploy, the new website deployment tool from Microsoft. I'm
I have just started reading about ORMLite since I am interested in using it
I just began reading more about Markov Chain Generators today, and am really intrigued

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.