⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asm.vs.c.min.asm.asm

📁 代码优化,有效使用内存,透视优化技术,对比优化方法,如果你在追求代码效率的最大化,该资源你不能不读.
💻 ASM
字号:
; /*--------------------------------------------------------------------------
;  *
;  *			ASSEMBLER IMPLEMENTATION OF THE PROCEDURE OF SEARCHING FOR  MINIMUM
;  *
; ------------------------------------------------------------------------- */
.386
.MODEL FLAT
.CODE

_asm_min	proc
	PUSH	ESI					; saving
	PUSH	EDI					;			registers

	MOV	ESI,[ESP+8+4]			; preparing src
	MOV	EDX,[ESP+8+8]			; preparing n

	CMP	EDX,2					; if n < 2 exit
	JB	@exit					;

	LODSD						; take the first double word and...
	MOV	EDI, EAX				; ...temporarily assign it as the smallest number

@for:
	LODSD						; take the next double word
	CMP	EDI, EAX				; if the smallest double word is smaller 
	JB	@next					; than this value, than everything is OK,
	MOV	EAX, EDI				; otherwise the title of
								; "the smallest" number is given to the next value
@next:
	DEC	EDX						; decrease the counter of processed double words by 1
	JNZ	@for					; repeat until all double words
								; are processed
		
@exit:
	POP	EDI						; restoring
	POP	ESI						;					registers

	ret							; returning
_asm_min	endp
END


⌨️ 快捷键说明

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