Re: [問卦] 資工系不會指標怎麼辦?消失

看板Gossiping作者時間8年前 (2017/04/06 14:23), 8年前編輯推噓9(1011)
留言12則, 11人參與, 最新討論串2/10 (看更多)
※ 引述《Uniqueness (noman)》之銘言: : 指標,c語言系列的門神 : 所有入門的人幾乎都會在指標卡住 : 餘下就是看自身資質看可以多久突破這個門神 : 但縱觀所有程式語言,只有c語言有指標的概念 : 所以我說,不會指標應該也沒什麼關係吧? 智慧是解決問題 大智慧是讓問題不存在 教你一招 讓你不要再面對奇怪的指針問題 詳見這網頁 有五本書可下載 https://software.intel.com/en-us/articles/intel-sdm #include <stdio.h> char format[] = "%s %s\n"; char hello[] = "Hello"; char world[] = "earth"; int main(int argc, char *argv[]) { #ifdef _MSC_VER __asm { mov eax, offset world push eax mov eax, offset hello push eax mov eax, offset format push eax call printf } #endif #ifdef __GNUC__ asm(".intel_syntax noprefix"); asm("mov eax, offset world"); asm("mov eax, offset hello"); asm("push eax"); asm("mov eax, offset format"); asm("push eax"); asm("call printf"); #endif } 學甚番邦胡語 直接面向處理器母語吧 擺除指針 就從內聯匯編開始 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 24.5.126.55 ※ 文章網址: https://www.ptt.cc/bbs/Gossiping/M.1491459790.A.9F3.html ※ 編輯: KILLE (24.5.126.55), 04/06/2017 14:24:51

04/06 14:24, , 1F
大概是這樣沒錯
04/06 14:24, 1F

04/06 14:25, , 2F
跟我想的一樣
04/06 14:25, 2F

04/06 14:25, , 3F
嫩 我只直寫0101 你還在組語
04/06 14:25, 3F

04/06 14:27, , 4F
hello world
04/06 14:27, 4F

04/06 14:30, , 5F
是用Stack?
04/06 14:30, 5F

04/06 14:33, , 6F
結果你還不是在寫C
04/06 14:33, 6F
作業要用VC或gcc寫啊 不然直接用masm或是yasm那更好啊 ※ 編輯: KILLE (24.5.126.55), 04/06/2017 14:37:45

04/06 14:38, , 7F
寫啥組語啦 很難懂耶
04/06 14:38, 7F

04/06 14:39, , 8F
把 $1, $2 相加的結果 放到$3啦
04/06 14:39, 8F

04/06 14:55, , 9F
組語喔 .....跳過
04/06 14:55, 9F

04/06 15:18, , 10F
inline assembly 雙刃劍啦 自己斷絕讓 compiler 再幫你
04/06 15:18, 10F

04/06 15:18, , 11F
最佳化的空間
04/06 15:18, 11F

07/04 23:01, , 12F
你把ARM放哪了
07/04 23:01, 12F
文章代碼(AID): #1OvTxEdp (Gossiping)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 10 篇):
文章代碼(AID): #1OvTxEdp (Gossiping)