MASM addLoop

  1. Include Irvine32.inc
  2. .data
  3.     total byte "result : ",0dh,0ah,0
  4.     sum dword 0
  5. .code
  6.     main proc
  7.     mov ecx, 5
  8.     mov eax, 0
  9.     mov ebx, 1
  10.     L1:
  11.     add eax, ebx
  12.     add sum, eax
  13.     call writeint
  14.     call crlf
  15.     Loop L1
  16.     mov edx, offset total
  17.     mov eax, sum
  18.     call writeint
  19.     exit
  20.     main endp
  21.     end main

留言

這個網誌中的熱門文章

Codeforces --- string task

Uva 674 ---- coin change

codeforces 271A --- beautiful year