📄 macros.asm
字号:
;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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -