| 数据搜索系统,热门电子元器件搜索 |
|
AN1106 数据表(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1106 数据表(HTML) 7 Page - STMicroelectronics |
|
7 / 9 page ![]() 7/9 TRANSLATING ASSEMBLY CODE FROM HC05 TO ST7 4.4 MACROS You can define your macros directly in the source file where they are used or if there are too many and/or if you use one macro in several source files, you can define them in a macro.inc file that you will have to include in all the source files (where the macros are used): appli.asm: Let’s consider the same appli.asm source file given above. Let’s imagine that instead of the missing source code in this file (......., see above) we call a macro: MACRO1 Remember that a macro is a faster way than a functions for executing the same code several times. However program size is bigger when you use macros instead of subroutines; each time you invoke a macro to do a particular job, the whole macro assembly code is inserted into your source code. Macros are very useful when a small section of code must be used repeat- edly. The macro syntax is the following: macro_name MACRO [parameter_1] [,parameter_2...] [LOCAL label_name] [Body_of_the_macro] MEND ; ENDM macro.inc: .MACRO1MACRO LOCAL loop1 loop1 LD A,$C000; A loaded with the value at the address $C000 JRNE loop1 ; loop until this value equals 0 (after an inter- rupt for ; example). MEND The “LOCAL” directive avoids getting duplicate label errors for labels inside the macro (be- cause the same macro can be called several times in the same module). 4.5 MAP FILE Don’t forget you also have to include the map file of the device you use, for example in your source files, you can have among the included files: #include “ST72251.inc” The corresponding ST72251.asm file will have to appear in the batch file. |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |