Home > Backend Development > Golang > How to get the relevant instruction code from the instruction byte?

How to get the relevant instruction code from the instruction byte?

王林
Release: 2024-02-05 22:27:03
forward
529 people have browsed it

How to get the relevant instruction code from the instruction byte?

Question content

When I run a Go program that contains some Go assembly code, I receive the following error message:

SIGILL: illegal instruction
PC=0x508c04 m=0 sigcode=2
instruction bytes: 0xc4 0x42 0x68 0xf2 0xea 0xc5 0xf9 0xef 0xc1 0x41 0x9 0xfd 0x45 0x1 0xee 0xc1
Copy after login

How to get the relevant instruction code from the instruction byte? I tried the https://github.com/golang/arch Decode method but I only got opcode 0.

Starting from the first byte 0xc4, it should be the VEX prefix.

CPU:Intel(R) Xeon(R) CPU E5-2620)

Operating system: Linux


Correct answer


This is ANDN, which is part of the BMI1 instruction set. On Intel, Haswell and newer support BMI1, but your chip is Sandy Bridge, which is a generation (or two, depending on how you count) too old.

The above is the detailed content of How to get the relevant instruction code from the instruction byte?. For more information, please follow other related articles on the PHP Chinese website!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template