asm("mov #01100h,PC ");
编译失败
warning: "../cmd.c", line 56: Assembly statement "mov #01100h,PC " creates a label, which may not be what was intended. Use a colon after a label or a space before a non-label to silence the warning.
warning: "../cmd.c", line 61: Assembly statement "nop" creates a label, which may not be what was intended. Use a colon after a label or a space before a non-label to silence the warning.
warning: "../cmd.c", line 56: Assembly statement "mov #01100h,PC " creates a label, which may not be what was intended. Use a colon after a label or a space before a non-label to silence the warning.
warning: "../cmd.c", line 61: Assembly statement "nop" creates a label, which may not be what was intended. Use a colon after a label or a space before a non-label to silence the warning.
"C:\Users\weiji\AppData\Local\Temp\1305610", ERROR! at line 436: [E0002] Illegal mnemonic specified
mov #01100h,PC
Errors in Source - Assembler Aborted
gmake: *** [cmd.obj] Error 1
gmake: Target 'all' not remade because of errors.
加一个\t tab键,编译就过了。
asm(" mov #01100h,PC ");
解决编译警告与错误
本文探讨了在使用特定汇编指令时遇到的编译警告和错误,详细分析了警告产生的原因,即编译器误将指令识别为标签,并提供了修正方法,只需在指令前添加一个 tab键即可避免这一问题,使编译顺利进行。
2万+

被折叠的 条评论
为什么被折叠?



