1

如何将输出写入屏幕?

 SECTION .data
 x:
   dd 1
   dd 5
   dd 2
   dd 18
 sum:
   dd 0
 SECTION .text
  mov eax,4 ; EAX will serve as a counter
  mov ebx,0 ; EBX will store the sum
  mov ecx, x ; ECX will point to the current
 top:
  add ebx, [ecx]
  add ecx,4 ; move pointer to next element
  dec eax ; decrement counter
  jnz top ; if counter not 0, then loop again
 done:
  mov [sum],ebx ; done, store result in "sum"
4

0 回答 0