⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 looper.c

📁 The Valgrind distribution has multiple tools. The most popular is the memory checking tool (called M
💻 C
字号:
#include <stdio.h>long long int arg = 0;long long int res = 0;extern void loop_plain ( void );asm("\n"".text\n"".globl loop_plain\n""loop_plain:\n""\tpushq %rcx\n""\tmovq $999, %rax\n""\tmovq arg, %rcx\n"".Lmn123plain:\n""\tdecq %rax\n""\tdecq %rax\n""\tdecq %rax\n""\tloop .Lmn123plain\n""\tmovq %rax, res\n""\tpopq %rcx\n""\tret\n");extern void loop_ne ( void );asm("\n"".text\n"".globl loop_ne\n""loop_ne:\n""\tpushq %rcx\n""\tmovq $999, %rax\n""\tmovq arg, %rcx\n"".Lmn123ne:\n""\tdecq %rax\n""\tdecq %rax\n""\tdecq %rax\n""\tloopne .Lmn123ne\n""\tmovq %rax, res\n""\tpopq %rcx\n""\tret\n");extern void loop_e ( void );asm("\n"".text\n"".globl loop_e\n""loop_e:\n""\tpushq %rcx\n""\tmovq $999, %rax\n""\tmovq arg, %rcx\n"".Lmn123e:\n""\tdecq %rax\n""\tdecq %rax\n""\tdecq %rax\n"/* invert the Z flag */"\tpushfq\n""\txorq $64, 0(%rsp)\n""\tpopfq\n""\tloope .Lmn123e\n""\tmovq %rax, res\n""\tpopq %rcx\n""\tret\n");int main ( void ){   res = 0; arg = 10;  loop_plain(); printf("res = %lld\n", res);   res = 0; arg = 10;  loop_ne();    printf("res = %lld\n", res);   res = 0; arg = 500; loop_ne();    printf("res = %lld\n", res);   res = 0; arg = 10;  loop_e();     printf("res = %lld\n", res);   res = 0; arg = 500; loop_e();     printf("res = %lld\n", res);   return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -