prtarry.asm

来自「<<inter 汇编程序设计>>的源代码」· 汇编 代码 · 共 35 行

ASM
35
字号
TITLE PrintArray Procedure                  (PrtArry.asm)

; Last update: 1/18/02

INCLUDE Irvine32.inc

.code
;-----------------------------------------------------------
PrintArray PROC USES eax ecx edx esi,
	pArray:PTR DWORD,		; pointer to array
	Count:DWORD		; number of elements
;
; Writes an array of 32-bit signed decimal integers to
; standard output, separated by commas
; Receives: pointer to array, array size
; Returns: nothing
;-----------------------------------------------------------
.data
comma BYTE ", ",0
.code
	mov esi,pArray
	mov ecx,Count
	cld		; direction = forward

L1:	lodsd		; load [ESI] into EAX
	call WriteInt		; send to output
	mov  edx,OFFSET comma
	call Writestring		; display comma
	loop L1

	call Crlf
	ret
PrintArray ENDP

END

⌨️ 快捷键说明

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