sum1.asm

来自「想学习汇编语言的」· 汇编 代码 · 共 56 行

ASM
56
字号
TITLE Integer Summation Program		  (Sum1.asm)

; This program inputs multiple integers from the user,
; stores them in an array, calculates the sum of the
; array, and displays the sum. Chapter 5 example.

INCLUDE Irvine32.inc

.data
first DWORD 2323423424
second BYTE "adjaslfdjsl"

.code
main PROC
; Main program control procedure.
; Calls: Clrscr, PromptForIntegers,
;        ArraySum, DisplaySum

	exit
main ENDP

;-----------------------------------------------------
PromptForIntegers PROC
;
; Prompts the user for an array of integers, and
; fills the array with the user's input.
; Receives: ESI points to an array of
;   doubleword integers, ECX = array size.
; Returns: the array contains the values
;   entered by the user
; Calls: ReadInt, WriteString
;-----------------------------------------------------
	ret
PromptForIntegers ENDP

;-----------------------------------------------------
ArraySum PROC
;
; Calculates the sum of an array of 32-bit integers.
; Receives: ESI points to the array, ECX = array size
; Returns:  EAX = sum of the array elements
;-----------------------------------------------------
	ret
ArraySum ENDP

;-----------------------------------------------------
DisplaySum PROC
;
; Displays the sum on the screen
; Recevies: EAX = the sum
; Calls: WriteString, WriteInt
;-----------------------------------------------------
	ret
DisplaySum ENDP

END main

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?