0

How do I convert 8086 hexadecimal opcode to assembly language with c++ so I can execute. Example take

0B0h 01h
002h C0h
002h C0h
002h C0h
002h C0h
002h C0h
002h C0h
002h C0h
002h C0h
0CDh 20h

into an a file or array and convert it to 

    mov al,1                                       
    add al,al                                 
    add al,al                                 
    add al,al                                 
    add al,al                                 
    add al,al                                 
    add al,al                                 
    add al,al                                 
    add al,al                                 
    int 20h  
in c++
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 3
    If you want to *execute* the code, wouldn't it make more sense to convert the hexadecimal code into the actual binary instructions? And what is the *actual* problem you have that you need to solve? Where do you get this hexadecimal instructions from? Why do you think you need to (in a way) disassemble them into their assembly representation? What are you going to do with the assembly code once you got it? And in general, what is your assignment, and what requirements do you have? – Some programmer dude Mar 25 '20 at 10:53
  • 1
    The CPU executes binary machine code. Disassembling it is the opposite of what you'd to execute it. You're writing a disassembler that would let humans look at it. To write one, you need a copy of an instruction-set reference manual such as Intel's that has an opcode map and details on how ModRM bytes encode operands for opcodes that have a ModRM. – Peter Cordes Mar 25 '20 at 10:53

0 Answers0