A macro is a powerful preprocessing command of the assembler. It is similar to other preprocessing commands and starts compilation in the assembler.
Code Previously, the macro was processed. Its syntax rules are as follows:
Name macro [parameter [: Tag] [, parameter [: Tag]…]
[Local varlist]
Statements
[Exitm [textitem]
Endm
Name is a unique identifier.
Progr
0. PrefaceFrom the beginning of learning C language began to contact Makefile, consulted a lot of makefile information but always feel no real master makefile, if you write a makefile always feel very laborious. So deliberately using the blog to summarize the relevant knowledge of makefile, through examples to illustrate the specific use of makefile. The example says that makefile roughly divides into 4 parts 1. Only a single C file 2. Contains multiple C files 3. Need to include header file pa
In GNU C, a macro can accept a variable number of arguments, just like a function__va_args__ can be regarded as the ... Assign a value to the macro // Note you can't call ABC () #include #include #define ABC (...) printf (__va_args__) /* void ABC (...) {//printf (__va_args__);} */ int Main () {ABC ( " %s\n , " hello ); return 0 ;} Note that the m
They have a common advantage is "change the whole, to avoid the input error" What are the two different? Some.The main difference is that the macro definition is done prior to compilation, and the const is processed during the compilation phaseMacros define constants that do not occupy memory cells and are defined by const occupy memory unitsA macro definition has the same effect as a const constant-----t
MASM macro usage SummaryIntroductionMASM (macro volume ER) is an assembly tool provided by Microsoft. Although it has been around for some years, it still exists in newer tools such as vc.net. Many compilation textbooks take this as an object and show how to use compilation to design a program as a basic course for students in the Computer Science Department. However, the content is basically in version 5.1
Macro definition Simple macroFormat: #define Identifier substitution list#define N 100int a[N];//N就是100Macros with parametersFormat: #define identifier (x1, x2, x3,...... xn) Replace list#define MAX(x, y) ((x) > (y) ? (x) : (y))Note: When the program compiles, it will replace the uppercase identifier with the original expression, so the program will increase at compile time.Advantages or DisadvantagesAdvantages① program may be a little faster② Macros
Macro can be used to implement custom directives, by using custom directives, you can define a section of a template fragment as a user instruction, using the macro instruction syntax in the following format:.........In the above format fragment, the following sections are included:The Name:name property specifies the name of the custom directive and can pass in multiple parameters when using a custom direc
Some of the previous contents content as a student, rarely used, may be working to meet a little more, but the first comprehensive study still do not want to have something to fall, although not commonly used but at least have an impressionThen go to the third chapter "Macro __cplusplus"In code written in C and C + +, we often see the following declaration in the header file:#ifdef __cplusplus extern " C " {#endif // some code #ifdef __cplusplus} #
For example, I want to automatically delete an Excel form after March 2, 2013, and a macro called Macro1 in the table.
Specifically as follows:
Sub Macro1 ()
Private Sub Workbook_Open ()
Application.DisplayAlerts = False
Dim Datee as Date
Datee = #3/2/2013#
If Date > Datee Then
Activeworkbook.changefileaccess xlreadonly
Kill Activeworkbook.fullname
Thisworkbook.close False
End If
End Sub
But this ma
excel2010 How do I record a macro? Everyone has in the use of excel2010 encountered do not know how to record a macro difficulty? Small make up for you to dispel doubts!
1. First open Excel2010 new worksheet.
2. On the Main Development Tools tab, in the code group, click Record Macro.
3. Pop-up "Record Macro
Whim:In a language to write C + + plug-in, can replace the macro definition,You can do this by adding specific tags to C + +, such as The middle code can be translated into C + + code and compiled with the C + + compiler.Bothered:1.c++ macro must be anti-slash, and then need a lot of repetitive logic code, the need for macros to reduce the amount of code, to achieve efficient work;2. If there is a large num
This article first introduces Linux under the Classic macro definition, feel the wisdom of the geek, and then according to the classic definition for the next blog to pave the groundwork.Offsetof MacroDefinition:Gets the offset of the variable member (MEMBER) of the struct body (TYPE) in this struct. #define OFFSETOF (Type, MEMBER) ((size_t) ((TYPE *) 0)->member)Description: Gets the offset of the variable member (MEMBER) of the struct body (TYPE) in
First look at the macro definition of __user:
#ifdef __checker__# define __user __attribute__ (Noderef, Address_space (1))
As you can see from the macro definition, the __user macro definition is valid under the condition that you configure the __CHECKER__ macro, and it is obvious that the
C1 condition include
As follows:
Code
# Ifndef main_h _
# Define main_h _
Other content
# Endif
When we see the header file, the function is to prevent this header file from being included multiple times.
Repeated definitions occur when multiple include operations are performed. Therefore, you must use this definition in each header file.
If you still don't know how to use it, you can see the standard header file of C, such as fcntl. h.
2. Conditional compilation
As follows:
Code
# Ifdef _ deb
#define宏定义在C系开发中可以说占有举足轻重的作用. The underlying framework does not have to say, in order to compile optimization and convenience, as well as cross-platform capabilities, macros are heavily used, it can be said that the bottom of development left define will be unable to move. When developing at a higher level, we put more emphasis on business logic and seem to have little use and reliance on macros.But the benefits of using macro definitions are self-exp
#springMessage ("xxx") to deal with internationalization:The way spring handles internationalization can be very special, because this tag can be used.This tag is used only after spring has integrated the velocity template. This template is available in:Org.springframework.web.servlet\src\main\java\org\springframework\web\servlet\view\velocity\spring.vmThe first macro in the velocity template is the springmessage tag, and there are other markers, whic
In the book or the novel print, you do not set reverse order printing, then the paper will need to be rearranged, because the first page is placed in the bottom, many words obviously not that time to another one of the tune. Here's how to use the macro method to solve Excel table in reverse order printing.
Start the Excel table and click View-Macro-to record the macro
Macro definition that contains if
When the macro definition contains an IF
1) define the following macros#define DC (P) if (foo (p)) fun (p)
Used in the following environment
if (k>n)
DC (k);
Else
DC (n);
After the macro is replaced, the following
if (k>n)
if (foo (k))
Fun (k);
Else
if (foo (n))
Fun (n);
Visible, the original if and else are no longer paired.
Recently, because of the beginning of the real use of the new Tang M051, began to understand the new Tang M0 especially the charm of M051. Learn the official good intentions. Experience the unique charm of m0+51, yes, he is to mess up the 8-bit machine market, the goal is to become and 8051 comparable to the single-chip microcomputer. He did it. Many people in the AVR era, feel that the port alone assignment is inconvenient: for example-
Two X LCD ports:
Lcd_clk
Lcd_dat
To pull high and low, a l
People who are new to MFC programming are often intimidated by various macro definitions and preprocessing commands generated by the MFC wizard. However, preprocessing and macro definition are a powerful tool in C language. They can be used for simple source code control, version control, warning, or some special functions. A classic exampleThe most classic example of using preprocessing and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.