macros.asm

来自「这是一个数字图像处理的matlab仿真程序」· 汇编 代码 · 共 61 行

ASM
61
字号
;Macros

LOWORD	MACRO 	bigword	;; Retrieves the low word from double word argument

	mov	eax,bigword
	and	eax,0FFFFh	;; Set to low word 
	ENDM

HIWORD	MACRO bigword  		;; Retrieves the high word from double word 

	mov	eax,bigword
	shr	eax,16		;; Shift 16 for high word to set to high word
	ENDM

MAX	MACRO   word1, word2	;; Return the maximum of 2 integers in eax

	mov	eax,word1
	.IF	eax < word2
	mov	eax,word2	;; Set word2 as max
	.ENDIF
	ENDM

MIN	MACRO	word1, word2	;; Return the minimum of 2 integers in eax

	mov	eax,word1
	.IF	eax > word2
	mov	eax,word2	;; Set word2 as min
	.ENDIF
	ENDM

M2M 	MACRO M1, M2		;; Copy word from memory to memory
        push M2
        pop  M1
        ENDM

RGB	MACRO red, green, blue	;; Get composite number from red green and blue bytes 

	mov	al,blue			;; ,,,blue	
	shl	eax,8			;; ,,blue,

	add	al,green		;; ,,blue,green
	shl	eax,8			;; ,blue,green,
	add	al,red			;; ,blue,green,red
	and	eax,0FFFFFFh		;; Mask out top byte to complete COLORREF dword 
	ENDM

M2M	MACRO   arg1, arg2
	
	push	arg2
	pop	arg1

	ENDM
	
return  MACRO arg

        mov eax, arg
        ret
        ENDM


⌨️ 快捷键说明

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