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

📄 store_buff_nop.xm

📁 代码优化,有效使用内存,透视优化技术,对比优化方法,如果你在追求代码效率的最大化,该资源你不能不读.
💻 XM
字号:
; N_ITER EQU	?	;// <-- !auto gen!

; /*--------------------------------------------------------------------------
;  *
;  *			 macro that automatically duplicates its body N times
;  *
; ---------------------------------------------------------------------------*/
STORE_BUFF MACRO N
	_N = N			
	_A = 0			 
	WHILE _A NE _N	 
		NOP				; 			<-- MACRO BODY		 
		_A = _A + 1  
	ENDM
ENDM


; /*--------------------------------------------------------------------------
;  *
;  *		DEMONSTRATION OF BUFFER UNLOADING DURING BUS IDLE TIME
;  *
; ---------------------------------------------------------------------------*/
	MOV	[ESI],	ECX		; *p = a;	<-	here we write some value into *p
						;			<-	first of all, this value
						;			<- 	goes to the store buffer

	STORE_BUFF	N_ITER	; ...       <-	one or more NOPs
						; ...		 	in parallel with NOP execution
						; ...   		buffer contents is unloaded into L1 (AMD)
						; ...			or L2 (Intel) cache

	MOV	EDX,	[ESI]	; b=*p;		<-	reading the contents of the *p cell
						;				if by that moment the buffer corresponding to it
						;				us not unloaded, it will be read as fast as
						;				possible;  otherwise the delay would occur	
						
	ADD	ESI,	32*20	; (int)p+32 <-	move the pointer to the next buffer	

⌨️ 快捷键说明

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