NASM에서 Macro의 작성법은 아래와 같다.
Macros
The built-in macro system has the following syntax:
.macro <name> <args>
<operations>
.endm
Example:
.macro write string
movw string, %si
call printstr.
endm
This would be equivalent to the NASM macro:
상당히 유용한 기능인것 같다. 코드가 확 줄어버리네. @0@
크게 세부분으로 나눌 수 있다.
각 부분을 정의하는 코드는 아래와 같다.
위와 같이 쓰면 사용할 수 있다.