![]() |
|
論壇說明 |
歡迎您來到『史萊姆論壇』 ^___^ 您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的! 請點擊這裡:『註冊成為我們的一份子!』 |
|
主題工具 | 顯示模式 |
![]() |
#1 |
註冊會員
|
![]() 小弟這學期剛開始學組合語言,結果第一次作業就讓我好頭大啦,所以來這邊求幫忙了QQ
這是其中一題的題目: Write a program with a loop and addressing that exchanges every pair of values in an array with an even number of elements. Therefore, item i will exchange with i+1, and item i+2 will exchange with item i+3, and so on. 然後以下是我目前的程式碼: TITLE 4_10_2 (4_10_2.asm) ; This program is homework1 4_10_2 INCLUDE Irvine32.inc .data array BYTE 00h, 11h, 22h, 33h, 44h, 55h, 66h, 77h, 88h, 99h .code main PROC mov ecx, lengthof array L1: mov al, [array+ecx-1] xchg al, [array+ecx-2] mov [array+ecx-1], al sub ecx, 1 loop L1 exit main ENDP END main -------------------------------------------------------------------------------------- 我的問題是我不知道該如何把array輸出到螢幕上.... 還有不知道我這樣寫有沒有符合題目的要求?? |
![]() |
送花文章: 75,
![]() |