gcc内联汇编_在Linux上使用GCC内联汇编

gcc内联汇编

One cool feature of gcc is that it can inline assembly into C code. With inline assembly, the programmer can precisely control the execution of the processor, such as forcing variables to use registers, getting special processor state efficiently, and writing critical efficient code in assembly by hand.

gcc的一个很酷的功能是它可以内联汇编成C代码。 使用内联汇编,程序员可以精确地控制处理器的执行,例如强制变量使用寄存器,有效地获取特殊的处理器状态以及手动编写关键高效的代码。

I compile a list of tutorials from the Internet about inline assembly with gcc on Linux. These tutorials use AT&T syntax for assembly on x86 system. For x86-64, the difference with x86 is small. The method is similar, just the type of instructions and registers, such as movq, %rax, %r15.

我从Internet上汇编了有关在Linux上使用gcc进行内联汇编的教程列表。 这些教程使用AT&T语法在x86系统上进行组装。 对于x86-64,与x86的差异很小。 该方法是相似的,只是指令和寄存器的类型,例如movq,%rax,%r15。

GCC-Inline-Assembly-HOWTO by Sandeep.S

GCC-在线组装-HOWTO ,Sandeep.S

“This HOWTO explains the use and usage of the inline assembly feature provided by GCC. There are only two prerequisites for reading this article, and that’s obviously a basic knowledge of x86 assembly language and C.”

“本指南解释了GCC提供的内联装配功能的使用和用法。 阅读本文只有两个先决条件,并且显然是x86汇编语言和C的基本知识。”

Brennan’s Guide to Inline Assembly by Brennan “Bas” Underwood

Brennan “ Bas” Underwood编写的Brennan 在线组装指南

“This is meant to be an introduction to inline assembly under DJGPP. DJGPP is based on GCC, so it uses the AT&T/UNIX syntax and has a somewhat unique method of inline assembly.”

“这是对DJGPP下的内联汇编的介绍。 DJGPP基于GCC,因此它使用AT&T / UNIX语法,并且具有某种内联汇编的独特方法。”

Using Assembly Language in Linux. by Phillip

在Linux中使用汇编语言 。 菲利普(Phillip)

“This article will describe assembly language programming under Linux. Contained within the bounds of the article is a comparison between Intel and AT&T syntax asm, a guide to using syscalls and a introductory guide to using inline asm in gcc.

“本文将介绍Linux下的汇编语言编程 。 本文范围内是对Intel和AT&T语法asm之间的比较,使用syscall的指南以及在gcc中使用嵌入式asm的入门指南。

This article was written due to the lack of (good) info on this field of programming (inline asm section in particular), in which case i should remind thee that this is not a shellcode writing tutorial because there is no lack of info in this field.”

撰写本文是由于缺少此编程领域(尤其是内联asm部分)的(良好)信息,在这种情况下,我应该提醒您,这不是Shellcode编写教程,因为本教程中并不缺少信息领域。”

翻译自: https://www.systutorials.com/inline-assembly-with-gcc-on-linux/

gcc内联汇编

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值