CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@Len • 27 Oct, 2012

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.

@simplycoder • 27 Oct, 2012 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 • 28 Oct, 2012 https://www.mlsite.net/8086/
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] • 28 Oct, 2012 • 1 like
Len
https://www.mlsite.net/8086/
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 • 28 Oct, 2012
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 • 28 Oct, 2012 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 • 28 Oct, 2012 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.
@Kavya Burramolla • 01 Feb, 2020

Generally, the structure of the instructions in microprocessor has 4 parts. Label, Opcode, Operand, Comments. 

Here the label is the starting part of the code that can be a number or a symbol. Label is assigned the current value of the active location counter and serves as an instruction operand. Opcodes are also known as operational code or the opstring. They define the function that needs to be carried on the input variables. For example opcode MOV - is for the move operation, ADD, SUB, DIV are some of the examples of the opcode.

Operands are trhe input variables. And comments are the remarks given at the end of the instruction for ease of understanding. For example : - 1: ADD A, B ; # adds the value of two variables A and B. Here 1 is the label, ADD is the opcode, A,B are operands and text after # is the comment.

Opcode conversion is nothing but the translation to binary digits.Every opcode has its binary equivalent.  

5k views

Related Posts

@arrvvii · Oct 7, 2014

Candidates (like me) with backlogs are asked to upload either 1. Last semester marksheet (i dont have it so..i can't upload it) or 2. Certificate from principal! In certificate from...
3.9k views

@Kaustubh Katdare · Jul 27, 2014

OnePlus ONE, the phone that brands itself as the 2014 flagship killer has announced the plans to launch the phone in India. No wonder the team at this Chinese startup,...
18.4k views

@psbabu · Mar 11, 2008

I am a mechanical engineering student. as i passed thru the automatic transmission , i came to know abt the torque convertor. will it be possible to fix a torque...
10.7k views

@Mahesh Shelke · May 24, 2012

Can Anyone please post Solid Edge v 20 tutorials .. I have searched internet but coulldnt get any :S
8.1k views

@siddhesh nisal · Jul 21, 2014

hello everyone i am new here i have some queries regarding my career i am 23 years old guy i have completed my diploma in 4 year instead of regular...
24.8k views