我有一段很短的匯編程序,可裏麵linux system call運行有問題。。

來源: MGM 2006-08-02 10:35:44 [] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (289 bytes)
我的目的就是用linux system call: write, 來實現pascal 中的標準輸出write(). 可是,我運行的結果是 'VT102', 用debugger 發現有segmentation fault (我改用C 語言裏的printf, 然後用gcc 編譯, 輸出的就是正確的). 有沒有哪位熟悉匯編語言中使用Linux system call 的願意幫我看看是什麽問題? 十分感謝。。

所有跟帖: 

Then why don't you copy the compiled code and patch it in yours -德州老外- 給 德州老外 發送悄悄話 (0 bytes) () 08/02/2006 postreply 10:59:17

but gcc will produce the obj file and exe file, not useful to me -MGM- 給 MGM 發送悄悄話 (207 bytes) () 08/02/2006 postreply 12:05:37

看來熱心人挺多的。我的具體問題是。。 -MGM- 給 MGM 發送悄悄話 (1524 bytes) () 08/02/2006 postreply 11:49:49

我試過,不是exit 的緣故。有了exit call 也不行 -MGM- 給 MGM 發送悄悄話 (0 bytes) () 08/02/2006 postreply 12:51:13

strange, I attached your code to the end, still get seg-fault. -MGM- 給 MGM 發送悄悄話 (457 bytes) () 08/02/2006 postreply 13:30:53

still, not working.. -MGM- 給 MGM 發送悄悄話 (396 bytes) () 08/02/2006 postreply 14:04:13

still not working.. -MGM- 給 MGM 發送悄悄話 (396 bytes) () 08/02/2006 postreply 14:03:16

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”