[問題] C code 翻譯 組合語言 (已解決)

看板C_and_CPP作者 (蛇王)時間12年前 (2013/04/10 20:00), 編輯推噓0(114)
留言6則, 6人參與, 最新討論串1/1
問題(Question): 請將以下C code翻譯為相同效果的組合語言code。 運算部分請用inline assembly完成。 餵入的資料(Input): 5 6 30 預期的正確結果(Expected Output): (5+6)*30=330 程式碼(Code):(請善用置底文網頁, 記得排版) int cal(int a, int b, int c) { int ans; ans = a + b; ans *= c; return ans; } int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); printf("(%d+%d)*%d=%d\n",a,b,c,cal(a,b,c)); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.40.106.164

04/10 20:05, , 1F
什麼機器的 得用內嵌嗎
04/10 20:05, 1F

04/10 20:05, , 2F
修一次不會,你有試過重修嗎?
04/10 20:05, 2F
有善心人士願意認真解答一下嗎?小弟必定以某種方式報答您。 ※ 編輯: morris0117 來自: 114.40.106.164 (04/10 20:41)

04/10 23:01, , 3F
你直接對compiler下指令叫他編出組語就好了
04/10 23:01, 3F

04/11 03:23, , 4F
在vs 打 ctrl+F11 秒殺
04/11 03:23, 4F

04/11 06:44, , 5F
你的意思是不回你這種作業文的前兩樓就是不善心人士囉?
04/11 06:44, 5F

04/11 17:01, , 6F
我覺得前兩樓很認真阿...
04/11 17:01, 6F
文章代碼(AID): #1HPLHHAl (C_and_CPP)