ChinaUnix.net
相关文章推荐:

汇编代码

如何 实现在perl程序中 嵌入汇编代码? 请高手指教

by zhangzhangg - Perl - 2007-10-09 18:47:11 阅读(1763) 回复(0)

相关讨论

各位大侠, 我有一个在VC下写的C程序,其中核心代码是用汇编写的(——asm...) ,请教如何在SCO unix下编译运行,急盼回音。 多谢多谢。

by cadet888 - 其他UNIX - 2004-11-30 11:37:59 阅读(939) 回复(3)

这个程序改编自Thinking in C++的Instrument4.cpp,讲的是虚函数,代码如下: #include using namespace std; enum note { middleC, Csharp, Cflat }; // Etc. class Instrument { public: virtual void play(note) const { cout << "Instrument::play" << endl; } virtual char* what() const { return "I...

by kenby - C/C++ - 2009-02-21 16:03:41 阅读(1705) 回复(4)

大家都知道gdb调试的时候,如果使用命令 display /i $pc 每次程序中断后就可以看到即将被执行的下一条汇编指令比如: 0x8048771 : movl $0x0,-0x28(%ebp) 这样只能一条一条的看,很不方便,能不能把所有的汇编指令一次性的输出?

by kenby - C/C++ - 2009-02-05 17:14:21 阅读(6875) 回复(10)

#define spi_delay(delay) {register unsigned int i=0;while(i<(delay)){__asm{nop;nop;nop;nop;}i-=4;}} 上面这一句什么地方写得不对?Linux+GCC环境。

by pilgrim_kevin - C/C++ - 2008-11-13 09:49:01 阅读(1836) 回复(5)

有两个arm asm文件,属于gnu asm语法,后缀为.S .加入project以后,可能被认为是intel 汇编,编译出错。 我看编译Rules里的编译器为Nasm,是不是应该改这个地方呢?还是别的方法?

by imbigapple - Mac OS X - 2009-01-12 19:56:37 阅读(8483) 回复(4)

如果我需要使用比较多的参数的时侯: 譬如: int function(int arg0, short arg1, char arg2, char arg3) { int a, b, c; __asm__( /*code here*/ ); } 在汇编中使用这些参数或变量的时候使用占位符,%0, %1... 如果需要使用的占位符比较多的时候,仍旧用%n可能会引起混乱,有什么好的解决方法吗?

by Godbach - C/C++ - 2008-06-04 13:58:46 阅读(1823) 回复(3)

#define EXCHANGE(ptr,val) \ { \ asm volatile ("lock; xchg %0,%1" : "=r" (val), "=m" (*ptr) : "m" (*ptr) , "0" (val) ); \ } 请问什么意思....... 还有这段代码有没有bug...

by ruchong - C/C++ - 2007-09-17 15:57:27 阅读(1584) 回复(4)

mov ax,#0x0000         cld ! 'direction'=0, movs moves forward do_move:         mov es,ax ! destination segment         add ax,#0x1000         cmp ax,#0x9000     &nbs...

by fcloudf - C/C++ - 2007-08-14 22:12:05 阅读(1755) 回复(4)

摘自 http://www.qqgb.com/Program/VC/VCZH/Program_105049_2.html -------------------------------------------------------------- ;boot.asm org 07c00h ; 程序会被加载到7c00处,所以需要这一句 mov ax, cs mov ds, ax mov es, ax Call DispStr ; 调用显示字符串例程 jmp $ ; 无限循环 DispStr: mov ax, BootMessage mov bp, ax ; ES:BP = 串地址 mov cx, 16 ; CX = 串长度 mov ax, 01301h ;...

by vity - 内核/嵌入技术 - 2006-11-20 12:52:59 阅读(1497) 回复(7)

譬如下面这段代码怎样理解: /* how to get the thread information struct from C */ static inline struct thread_info *current_thread_info(void) { struct thread_info *ti; __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1))); return ti; }

by airbridge - 内核/嵌入技术 - 2006-06-22 00:33:19 阅读(904) 回复(3)