Macros (notes)
来源:互联网 发布:哈尔滨淘宝代运营 编辑:程序博客网 时间:2024/04/30 04:42
http://www.emu8086.com/assembler_tutorial/asm_tutorial_10.html
1. like proc but not really.
exist only until the code is compiled.
after compilation, all macros are replaced with real instructions.
2.definition:
name MACRO [parameters,...]
<instructions>
ENDM
Unlike proc, macros should be defined above the code that uses it.
3. Some important facts
- use- "CALL MyProc" vs "MyMacro" (no CALL in using macro)
- procedure is located at some specific address in memory. When using it 100 times, the size grows very insignificantly. Macro is opposite because macro is expanded directly in program's code.
- Different in the method of passing parameters
- ENDM vs ENDP
4. Use LOCAL followed by names of variables, labels or procedure names in Macro
example:
MyMacro2 MACROLOCAL label1, label2
CMP AX, 2JE label1CMP AX, 3JE label2label1: INC AXlabel2: ADD AX, 2ENDMORG 100hMyMacro2MyMacro2RET
5. If using macros in several programs, put them in a INC file.
- Macros (notes)
- Lecture Notes: Macros
- Defending Macros
- useful macros
- macros.h
- Make Macros
- Predefined Macros
- Asterisk macros
- Variadic Macros
- Predefined Macros
- Creating Macros
- 16 Macros
- Notes
- notes
- Notes
- notes
- notes
- notes
- JNI学习笔记4——本地代码创建Java对象(包括javaString)
- 了解并选择产品版本。
- Procedures
- loadjava
- The stack in assembler (notes)
- Macros (notes)
- 搭建Eclipse C/C++开发环境
- JGSA SDAGD
- Pair Project 初体验(By Cuilin Lan & Xiao Fang)
- VC++程序开机自启动(注册表上注册)
- 「あく(開く)」と「ひらく(開く)」はどのように使い分ければいいですか。
- ToDoList如何从Word或者写字板复制任务列表进来
- ToDoList中如何添加重复执行的任务
- ............