[問題] 用C內嵌ASM作出類似print功能

看板C_and_CPP作者 (New page!)時間9年前 (2014/09/17 08:44), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) X86PC 在VirtualBox下安裝Ubuntu,使用gcc編譯 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 參考"程式設計師的自我修養"這本書的範例, 但實作後,無法顯示"Hello world" 字串,但也沒發生錯誤 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) https://gist.github.com/anonymous/1358f69b8d0c8a2ce803 補充說明(Supplement): 編譯過程 gcc -c -fno-builtin test.c ld -static -e nomain -o test test.o ./test -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.43.209.31 ※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1410914694.A.1FA.html

09/17 09:47, , 1F
-m32 掛到 gcc 那串試試, Fedora 20 ok
09/17 09:47, 1F

09/17 21:52, , 2F
可以了,感謝
09/17 21:52, 2F
文章代碼(AID): #1K6Dc67w (C_and_CPP)