Assembler Instructions with C Expression Operands

Using the GNU Compiler Collection For gcc version 4.9.3 (GNU Tools for ARM Embedded Processors)

In an assembler instruction using asm, you can specify the operands of the instruction using
C expressions. This means you need not guess which registers or memory locations contain
the data you want to use.

在实现C语言和汇编语言混合编程的时候会用到。可以比较灵活可靠地进行。

You must specify an assembler instruction template much like what appears in a machine
description, plus an operand constraint string for each operand.

图 freertos中C语言和汇编语言混合出现

 

图 freertos中C语言和汇编语言混合出现

 

posted @ 2022-08-25 14:02  panrui  阅读(15)  评论(0编辑  收藏  举报