mirror of
https://github.com/gatieme/LDD-LinuxDeviceDrivers.git
synced 2026-08-22 15:20:28 +08:00
19 lines
245 B
C
19 lines
245 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
|
|
// 不指定寄存器实现两个参数相减
|
|
int Sub(int a, int b)
|
|
{
|
|
__asm__ __volatile__
|
|
(
|
|
"subl %1, %0;"
|
|
: "=m"(a)
|
|
: "r"(b), "m"(a)
|
|
// :
|
|
);
|
|
|
|
return a;
|
|
}
|
|
|