[英]Error compiling C program with DevCpp when using inline assembly
我正在使用 DevCpp 編譯以下代碼,但出現問題:
#include<stdio.h>
int main(){
char s;
__asm(
"mov %ah, 1"
"int 21h"
"mov %ah,2"
"mov %dl,%al"
"int 21h"
);
return 0;
}
DevCpp編譯器產生的錯誤是:
錯誤:
int 21hmov %ah' after expression Error: too many memory references for
垃圾int 21hmov %ah' after expression Error: too many memory references for
mov' 的int 21hmov %ah' after expression Error: too many memory references for
我該如何解決這個問題?
FAQ 演示了在每個__asm
做一個語句。
__asm("mov %ah, 1") ;
__asm("int 21h" ) ;
__asm("ONE AND ONLY ONE INSTRUCTION") ;
您應該能夠用\\n
分隔行,但我沒有看到記錄。
__asm("mov %ah, 1\n"
"int 21h \n"
"MULTIPLE INSTRUCTIONS WITH \n") ;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.