Re: [問題] C語言中的asm使用方式

看板C_and_CPP (C/C++)作者 (返無)時間13年前 (2012/11/08 12:34), 編輯推噓2(202)
留言4則, 3人參與, 最新討論串2/2 (看更多)
你要克服的有兩點: * 你好像還不會寫組合語言 * 使用 gcc 系列, 建議學習 at & t syntax AT&T 彙編學習: http://www.cnblogs.com/brucewoo/archive/2010/07/27/2252032.html 在 linux 上學習 assembly language book: professional assembly language 還有嚇人的 placeholders 語法, 參考看看: http://descent-incoming.blogspot.tw/2012/01/x86-inline-assembly-gccgas.html ※ 引述《blueooosky (Blue)》之銘言: : 開發平台(Platform): (Ex: VC++, GCC, Linux, ...) : Dev C++ : 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) : No : 問題(Question): : C語言嵌入asm error : 餵入的資料(Input): : No : 預期的正確結果(Expected Output): : ? : 錯誤結果(Wrong Output): : Assembler messages: : too many memory references for 'mov' : 程式碼(Code):(請善用置底文網頁, 記得排版) : int main (void) : { : asm( : "mov dx,al" : "mov ah,dx" : ); : } : 補充說明(Supplement): : 剛開始學組語的使用方式,參考過網路上其他資訊,但還是不太懂,所以上來問各位大大~ : 請各位大大幫忙解惑,謝謝 ^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.125.239.46

11/08 14:58, , 1F
從nasm or masm (Intel Syntax) 入門如何?
11/08 14:58, 1F

11/08 19:28, , 2F
因為他是用devc++ ,devc++ 的 compiler 好像是 gcc 系列的
11/08 19:28, 2F

11/09 13:01, , 3F
謝謝大家!後來發現是Dev C++好像不能支援asm @@
11/09 13:01, 3F

11/09 13:02, , 4F
換成TurboC 再修改一些觀念錯誤的地方就可以work了~
11/09 13:02, 4F
文章代碼(AID): #1GcpPZW8 (C_and_CPP)
討論串 (同標題文章)
文章代碼(AID): #1GcpPZW8 (C_and_CPP)