8086 opcode conversion

Is there any method to rebuild an 8086 microprocessor instruction from its opcode? Also how can we convert the instruction to the opcode? I am trying to build an emulator, and cannot continue without knowing these. Thanks in advance.

Replies

  • simplycoder
    simplycoder
    I think firstly you have to maintain a mapping between you opcodes and instructions.
    so that there is some kind of relation between them.
    I believe there is a CEan who programmed emulator for the same.

    Just post some opcode along with the instruction,
    then we shall see how to tackle this.

    If you are making an emulator and you are serious about it, I advise you to keep separate array which will handle all the memory locations as you would need it.
  • Len
    Len
    #-Link-Snipped-#
    I found an opcode map in this link, but cant quite make out how the actual opcode is generated. I wish they had some examples 😔


    If you are making an emulator and you are serious about it, I advise you to keep separate array which will handle all the memory locations as you would need it.
    I am planning to store the memory locations in a database.
  • [Prototype]
    [Prototype]
    Len
    #-Link-Snipped-#
    I found an opcode map in this link, but cant quite make out how the actual opcode is generated. I wish they had some examples 😔




    I am planning to store the memory locations in a database.

    [​IMG]

    Its like ROW and COLUMN. So,

    0x00 = ADD
    0x10 = ADC

    Is it what you're asking?
  • Len
    Len
    Its like ROW and COLUMN. So,

    0x00 = ADD
    0x10 = ADC

    Is it what you're asking?
    No i got that part. What about the rest of the opcode? For example, what will be the opcode for the instruction MOV AX,BX ? And one i get the opcode,how can i convert it back to the original instruction?
  • simplycoder
    simplycoder
    I think you get a sheet which maps the opcodes to instructions, based on that sheet, you can create something like dictionary.

    If you have some opcode, search in your dictionary, find the corresponding instruction
  • manishks
    manishks
    yes there's a sheets which is needed to be referred while writing an opcode.
    1st 6 bits of code will be machine code of MOV instruction.
    Next bit descides the direction of data flow i.e it is from register to memory location or vice versa.
    Next bit(on right of direction bit) tells us if the data being transferred is word or data word or byte.
    Similarly rest of the bits are obtained by referring the table.

    Refer any microprocessor book on 8086.

You are reading an archived discussion.

Related Posts

As per poll, Our today's topic of technical discussion is "Power Transmission,Journey from Source to Destination". We'll be covering both Single-phase (home) transmission & Three-phase (Industries) transmission. So CEans, post...
Yosemite National Park in California is an amazing place. Stunning scenery with nature in all its finery and grandeur. The fire water fall shown in pictures here are a very...
A thrilling demo of way out physics from University of California, Los Angeles: https://www.uctv.tv/search-details.aspx?showID=20888
It appears that the right brain, the creative part gets active when one is physically at rest and awake. Interestingly left handed people may have more of this activity, because...
People, who are otherwise quite savvy fail to make secure pass words. When they do, they cannot remember them. After my Hotmail ID (used for technical activities) was hacked, I...