Is there a pattern to x86 op codes? (other than direction and size bits)
Asked Answered
C

0

3

The op code portion of many important x86 instructions like MOV and ADD has the last two bits standardized as a direction bit and a data size bit:

enter image description here

Is there any pattern to the part of the op code shown in gray here? For example, for ADD some of the instructions use the code 000000 and others have code 100000.

Chatterer answered 18/1, 2017 at 13:19 Comment(3)
Before the opcode space was exhausted IIRC there was some correlation between the octal value of the opcode and the semantic. More hereFlycatcher
I recommend you to have a look at the 8086 datasheet which contains an opcode map showing all the opcode patterns. For example, segment push/pops are of the form 000ss11p where ss indicates the segment register (00 = es, 01 = cs, 10 = ss, 11 = ds) and p indicates if its a push or a pop (0 = push, 1 = pop).Murtha
related: https://mcmap.net/q/1431891/-are-x86-opcodes-arbitraryLaughable

© 2022 - 2024 — McMap. All rights reserved.