彙編語言 自然數求和程序

算法:
((N+1)*N)/2

在這裏插入圖片描述

.386
include io32.inc
include kernel32.inc
includelib kernel32.lib
include msvcrt.inc
includelib msvcrt.lib
.data
num dword 234
sum dword ?
.code
start:
	mov eax,num
	add eax,1
	mul num
	shr edx,1
	rcr eax,1
	mov dword ptr sum,eax
	mov dword ptr sum+4,edx
	call dispuid
	exit 0
	end start
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章