亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nasmdoc4.htm

?? nasm手冊 大家可以看看 對要寫匯編程序的幫助很大
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<p><pre>myfunc: push    ebp         mov     ebp,esp         sub     esp,12</pre><p>The number <code><nobr>1</nobr></code> after the macro name in the<code><nobr>%macro</nobr></code> line defines the number of parameters themacro <code><nobr>prologue</nobr></code> expects to receive. The use of<code><nobr>%1</nobr></code> inside the macro definition refers to thefirst parameter to the macro call. With a macro taking more than oneparameter, subsequent parameters would be referred to as<code><nobr>%2</nobr></code>, <code><nobr>%3</nobr></code> and so on.<p>Multi-line macros, like single-line macros, are case-sensitive, unlessyou define them using the alternative directive<code><nobr>%imacro</nobr></code>.<p>If you need to pass a comma as <em>part</em> of a parameter to amulti-line macro, you can do that by enclosing the entire parameter inbraces. So you could code things like<p><pre>%macro  silly 2     %2: db      %1 %endmacro         silly 'a', letter_a             ; letter_a:  db 'a'         silly 'ab', string_ab           ; string_ab: db 'ab'         silly {13,10}, crlf             ; crlf:      db 13,10</pre><h4><a name="section-4.3.1">4.3.1 Overloading Multi-Line Macros</a></h4><p>As with single-line macros, multi-line macros can be overloaded bydefining the same macro name several times with different numbers ofparameters. This time, no exception is made for macros with no parametersat all. So you could define<p><pre>%macro  prologue 0         push    ebp         mov     ebp,esp %endmacro</pre><p>to define an alternative form of the function prologue which allocatesno local stack space.<p>Sometimes, however, you might want to `overload' a machine instruction;for example, you might want to define<p><pre>%macro  push 2         push    %1         push    %2 %endmacro</pre><p>so that you could code<p><pre>        push    ebx             ; this line is not a macro call         push    eax,ecx         ; but this one is</pre><p>Ordinarily, NASM will give a warning for the first of the above twolines, since <code><nobr>push</nobr></code> is now defined to be a macro,and is being invoked with a number of parameters for which no definitionhas been given. The correct code will still be generated, but the assemblerwill give a warning. This warning can be disabled by the use of the<code><nobr>-w-macro-params</nobr></code> command-line option (see<a href="nasmdoc2.html#section-2.1.18">section 2.1.18</a>).<h4><a name="section-4.3.2">4.3.2 Macro-Local Labels</a></h4><p>NASM allows you to define labels within a multi-line macro definition insuch a way as to make them local to the macro call: so calling the samemacro multiple times will use a different label each time. You do this byprefixing <code><nobr>%%</nobr></code> to the label name. So you can inventan instruction which executes a <code><nobr>RET</nobr></code> if the<code><nobr>Z</nobr></code> flag is set by doing this:<p><pre>%macro  retz 0         jnz     %%skip         ret     %%skip: %endmacro</pre><p>You can call this macro as many times as you want, and every time youcall it NASM will make up a different `real' name to substitute for thelabel <code><nobr>%%skip</nobr></code>. The names NASM invents are of theform <code><nobr>..@2345.skip</nobr></code>, where the number 2345 changeswith every macro call. The <code><nobr>..@</nobr></code> prefix preventsmacro-local labels from interfering with the local label mechanism, asdescribed in <a href="nasmdoc3.html#section-3.9">section 3.9</a>. Youshould avoid defining your own labels in this form (the<code><nobr>..@</nobr></code> prefix, then a number, then another period)in case they interfere with macro-local labels.<h4><a name="section-4.3.3">4.3.3 Greedy Macro Parameters</a></h4><p>Occasionally it is useful to define a macro which lumps its entirecommand line into one parameter definition, possibly after extracting oneor two smaller parameters from the front. An example might be a macro towrite a text string to a file in MS-DOS, where you might want to be able towrite<p><pre>        writefile [filehandle],"hello, world",13,10</pre><p>NASM allows you to define the last parameter of a macro to be<em>greedy</em>, meaning that if you invoke the macro with more parametersthan it expects, all the spare parameters get lumped into the last definedone along with the separating commas. So if you code:<p><pre>%macro  writefile 2+         jmp     %%endstr   %%str:        db      %2   %%endstr:         mov     dx,%%str         mov     cx,%%endstr-%%str         mov     bx,%1         mov     ah,0x40         int     0x21 %endmacro</pre><p>then the example call to <code><nobr>writefile</nobr></code> above willwork as expected: the text before the first comma,<code><nobr>[filehandle]</nobr></code>, is used as the first macroparameter and expanded when <code><nobr>%1</nobr></code> is referred to,and all the subsequent text is lumped into <code><nobr>%2</nobr></code> andplaced after the <code><nobr>db</nobr></code>.<p>The greedy nature of the macro is indicated to NASM by the use of the<code><nobr>+</nobr></code> sign after the parameter count on the<code><nobr>%macro</nobr></code> line.<p>If you define a greedy macro, you are effectively telling NASM how itshould expand the macro given <em>any</em> number of parameters from theactual number specified up to infinity; in this case, for example, NASM nowknows what to do when it sees a call to <code><nobr>writefile</nobr></code>with 2, 3, 4 or more parameters. NASM will take this into account whenoverloading macros, and will not allow you to define another form of<code><nobr>writefile</nobr></code> taking 4 parameters (for example).<p>Of course, the above macro could have been implemented as a non-greedymacro, in which case the call to it would have had to look like<p><pre>          writefile [filehandle], {"hello, world",13,10}</pre><p>NASM provides both mechanisms for putting commas in macro parameters,and you choose which one you prefer for each macro definition.<p>See <a href="nasmdoc5.html#section-5.2.1">section 5.2.1</a> for a betterway to write the above macro.<h4><a name="section-4.3.4">4.3.4 Default Macro Parameters</a></h4><p>NASM also allows you to define a multi-line macro with a <em>range</em>of allowable parameter counts. If you do this, you can specify defaults foromitted parameters. So, for example:<p><pre>%macro  die 0-1 "Painful program death has occurred."         writefile 2,%1         mov     ax,0x4c01         int     0x21 %endmacro</pre><p>This macro (which makes use of the <code><nobr>writefile</nobr></code>macro defined in <a href="#section-4.3.3">section 4.3.3</a>) can be calledwith an explicit error message, which it will display on the error outputstream before exiting, or it can be called with no parameters, in whichcase it will use the default error message supplied in the macrodefinition.<p>In general, you supply a minimum and maximum number of parameters for amacro of this type; the minimum number of parameters are then required inthe macro call, and then you provide defaults for the optional ones. So ifa macro definition began with the line<p><pre>%macro foobar 1-3 eax,[ebx+2]</pre><p>then it could be called with between one and three parameters, and<code><nobr>%1</nobr></code> would always be taken from the macro call.<code><nobr>%2</nobr></code>, if not specified by the macro call, woulddefault to <code><nobr>eax</nobr></code>, and <code><nobr>%3</nobr></code>if not specified would default to <code><nobr>[ebx+2]</nobr></code>.<p>You may omit parameter defaults from the macro definition, in which casethe parameter default is taken to be blank. This can be useful for macroswhich can take a variable number of parameters, since the<code><nobr>%0</nobr></code> token (see <a href="#section-4.3.5">section4.3.5</a>) allows you to determine how many parameters were really passedto the macro call.<p>This defaulting mechanism can be combined with the greedy-parametermechanism; so the <code><nobr>die</nobr></code> macro above could be mademore powerful, and more useful, by changing the first line of thedefinition to<p><pre>%macro die 0-1+ "Painful program death has occurred.",13,10</pre><p>The maximum parameter count can be infinite, denoted by<code><nobr>*</nobr></code>. In this case, of course, it is impossible toprovide a <em>full</em> set of default parameters. Examples of this usageare shown in <a href="#section-4.3.6">section 4.3.6</a>.<h4><a name="section-4.3.5">4.3.5 <code><nobr>%0</nobr></code>: Macro Parameter Counter</a></h4><p>For a macro which can take a variable number of parameters, theparameter reference <code><nobr>%0</nobr></code> will return a numericconstant giving the number of parameters passed to the macro. This can beused as an argument to <code><nobr>%rep</nobr></code> (see<a href="#section-4.5">section 4.5</a>) in order to iterate through all theparameters of a macro. Examples are given in<a href="#section-4.3.6">section 4.3.6</a>.<h4><a name="section-4.3.6">4.3.6 <code><nobr>%rotate</nobr></code>: Rotating Macro Parameters</a></h4><p>Unix shell programmers will be familiar with the<code><nobr>shift</nobr></code> shell command, which allows the argumentspassed to a shell script (referenced as <code><nobr>$1</nobr></code>,<code><nobr>$2</nobr></code> and so on) to be moved left by one place, sothat the argument previously referenced as <code><nobr>$2</nobr></code>becomes available as <code><nobr>$1</nobr></code>, and the argumentpreviously referenced as <code><nobr>$1</nobr></code> is no longeravailable at all.<p>NASM provides a similar mechanism, in the form of<code><nobr>%rotate</nobr></code>. As its name suggests, it differs fromthe Unix <code><nobr>shift</nobr></code> in that no parameters are lost:parameters rotated off the left end of the argument list reappear on theright, and vice versa.<p><code><nobr>%rotate</nobr></code> is invoked with a single numericargument (which may be an expression). The macro parameters are rotated tothe left by that many places. If the argument to<code><nobr>%rotate</nobr></code> is negative, the macro parameters arerotated to the right.<p>So a pair of macros to save and restore a set of registers might work asfollows:<p><pre>%macro  multipush 1-*   %rep  %0         push    %1   %rotate 1   %endrep %endmacro</pre><p>This macro invokes the <code><nobr>PUSH</nobr></code> instruction oneach of its arguments in turn, from left to right. It begins by pushing itsfirst argument, <code><nobr>%1</nobr></code>, then invokes<code><nobr>%rotate</nobr></code> to move all the arguments one place tothe left, so that the original second argument is now available as<code><nobr>%1</nobr></code>. Repeating this procedure as many times asthere were arguments (achieved by supplying <code><nobr>%0</nobr></code> asthe argument to <code><nobr>%rep</nobr></code>) causes each argument inturn to be pushed.<p>Note also the use of <code><nobr>*</nobr></code> as the maximumparameter count, indicating that there is no upper limit on the number ofparameters you may supply to the <code><nobr>multipush</nobr></code> macro.<p>It would be convenient, when using this macro, to have a<code><nobr>POP</nobr></code> equivalent, which <em>didn't</em> require thearguments to be given in reverse order. Ideally, you would write the<code><nobr>multipush</nobr></code> macro call, then cut-and-paste the lineto where the pop needed to be done, and change the name of the called macroto <code><nobr>multipop</nobr></code>, and the macro would take care ofpopping the registers in the opposite order from the one in which they werepushed.<p>This can be done by the following definition:<p><pre>%macro  multipop 1-*   %rep %0   %rotate -1         pop     %1   %endrep %endmacro</pre><p>This macro begins by rotating its arguments one place to the<em>right</em>, so that the original <em>last</em> argument appears as<code><nobr>%1</nobr></code>. This is then popped, and the arguments arerotated right again, so the second-to-last argument becomes<code><nobr>%1</nobr></code>. Thus the arguments are iterated through inreverse order.<h4><a name="section-4.3.7">4.3.7 Concatenating Macro Parameters</a></h4><p>NASM can concatenate macro parameters on to other text surrounding them.This allows you to declare a family of symbols, for example, in a macrodefinition. If, for example, you wanted to generate a table of key codesalong with offsets into the table, you could code something like<p><pre>%macro keytab_entry 2     keypos%1    equ     $-keytab                 db      %2 %endmacro keytab:           keytab_entry F1,128+1           keytab_entry F2,128+2           keytab_entry Return,13</pre><p>which would expand to<p><pre>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看亚洲精品| 亚洲mv在线观看| 日韩一区二区三区电影| 欧美亚洲动漫精品| 91精品1区2区| 欧美在线一二三| 欧美精品一卡二卡| 91麻豆精品91久久久久久清纯| 欧美日韩一区二区在线观看| 欧美日韩精品三区| 日韩一区二区在线看片| 欧美成人激情免费网| 久久精品一二三| 国产精品第13页| 亚洲一级二级在线| 日韩电影在线免费| 久久99国产精品成人| 国产一区二区三区观看| 国产91丝袜在线播放九色| 99久久国产综合精品女不卡| 欧美日韩亚洲综合| 精品噜噜噜噜久久久久久久久试看 | 99国产精品久久久久| 色素色在线综合| 欧美一卡二卡三卡| 国产精品嫩草久久久久| 午夜精品久久久| 国产麻豆精品95视频| 在线观看一区二区精品视频| 欧美成人一区二区三区在线观看| 欧美激情自拍偷拍| 视频一区视频二区中文| 国产福利不卡视频| 欧美日韩国产一级二级| 国产欧美一区二区精品性色| 亚洲精品视频在线| 国产一区二区三区综合| 欧美午夜寂寞影院| 中文字幕一区视频| 久久av资源站| 欧美日韩一区在线| 国产精品久久久久久久岛一牛影视| 亚洲国产精品久久久久婷婷884| 国产美女精品一区二区三区| 欧美性感一区二区三区| 国产精品无遮挡| 久久精品久久久精品美女| 欧洲激情一区二区| 中文字幕+乱码+中文字幕一区| 偷拍自拍另类欧美| 欧美午夜精品一区二区三区| 亚洲欧洲日韩在线| 国产中文字幕精品| 日韩一区二区三区av| 亚洲一区二区三区自拍| 成人午夜在线免费| 久久精品一区二区三区不卡牛牛 | 欧美日韩国产成人在线免费| 亚洲国产精品av| 狠狠色伊人亚洲综合成人| 欧美日韩高清一区二区| 亚洲一区在线视频| 色婷婷综合视频在线观看| 国产精品久久久一本精品| 国产精品综合一区二区三区| 欧美日韩国产大片| 亚欧色一区w666天堂| 色综合色综合色综合色综合色综合| 国产精品美女一区二区三区| 国产.欧美.日韩| 国产欧美日韩不卡| 国产一区二区中文字幕| 国产日韩综合av| 成人免费观看视频| 国产精品人成在线观看免费 | 亚洲综合无码一区二区| 一本大道久久a久久精品综合| 亚洲视频香蕉人妖| 色悠悠久久综合| 亚洲一区二区三区在线播放| 色婷婷国产精品综合在线观看| 亚洲免费观看高清完整版在线观看| 97超碰欧美中文字幕| 亚洲国产欧美另类丝袜| 欧美一区二区三区在线电影| 奇米一区二区三区| 精品日本一线二线三线不卡| 国产成人精品亚洲午夜麻豆| 亚洲国产精品国自产拍av| caoporm超碰国产精品| 亚洲激情中文1区| 欧美丝袜自拍制服另类| 麻豆精品视频在线观看视频| 国产午夜精品美女毛片视频| www.一区二区| 午夜激情久久久| 精品成人一区二区三区| av午夜一区麻豆| 婷婷综合另类小说色区| 久久精品水蜜桃av综合天堂| 一本色道亚洲精品aⅴ| 日本午夜精品一区二区三区电影| 久久久www成人免费无遮挡大片| 成人午夜激情片| 婷婷久久综合九色国产成人 | 日韩精品一区二区三区中文精品| 狠狠色丁香久久婷婷综合_中 | 日韩一级二级三级精品视频| 国产美女一区二区三区| 亚洲一区二区不卡免费| 久久久久久久久伊人| 在线一区二区三区| 蜜臀国产一区二区三区在线播放 | 久草在线在线精品观看| 日韩一区在线播放| 日韩精品一区二区三区在线| 色综合视频一区二区三区高清| 久久99精品网久久| 亚洲一区二区三区视频在线| 久久久久久影视| 91精品国产美女浴室洗澡无遮挡| 成人免费毛片高清视频| 激情文学综合网| 亚洲地区一二三色| 国产精品福利在线播放| 日韩美女一区二区三区四区| 欧美亚洲另类激情小说| 北条麻妃国产九九精品视频| 狠狠狠色丁香婷婷综合激情| 亚洲一区二区三区不卡国产欧美| 国产情人综合久久777777| 欧美电影免费观看高清完整版在| 在线视频综合导航| 97精品超碰一区二区三区| 国产激情91久久精品导航| 老司机精品视频在线| 日韩精品三区四区| 亚洲成人福利片| 一区二区不卡在线播放 | 国产尤物一区二区| 日本不卡1234视频| 日本中文在线一区| 午夜精品爽啪视频| 亚洲午夜国产一区99re久久| 亚洲免费在线播放| 一区二区免费看| 亚洲精品午夜久久久| 亚洲精品成人天堂一二三| 中文字幕一区二区日韩精品绯色| 中文字幕不卡的av| √…a在线天堂一区| 成人欧美一区二区三区视频网页| 国产午夜精品久久| 午夜在线电影亚洲一区| 亚洲午夜视频在线| 亚洲成a天堂v人片| 亚洲bt欧美bt精品777| 亚洲成人激情av| 日韩二区在线观看| 精品一区二区三区香蕉蜜桃 | 美女国产一区二区| 国产真实乱子伦精品视频| 国产精品一二三四区| 国产91精品一区二区| caoporn国产精品| 欧美无砖砖区免费| 欧美福利一区二区| 亚洲精品一区在线观看| 国产欧美日本一区二区三区| 国产精品热久久久久夜色精品三区 | 国产日本欧美一区二区| 国产精品乱码久久久久久| 亚洲视频图片小说| 丝袜美腿亚洲一区| 国产一区二区日韩精品| 成人av手机在线观看| 色综合天天性综合| 日韩免费观看高清完整版| 中文字幕乱码亚洲精品一区 | 久久九九久精品国产免费直播| 国产欧美日产一区| 亚洲动漫第一页| 国产一区二区0| 色域天天综合网| 久久综合九色综合欧美就去吻| 亚洲国产精品传媒在线观看| 亚洲成a人v欧美综合天堂| 黄色成人免费在线| 欧美日产在线观看| 国产精品视频九色porn| 日本中文字幕不卡| 99精品欧美一区二区蜜桃免费| 欧美精选午夜久久久乱码6080| 国产亚洲欧美一级| 天天免费综合色| 色欧美片视频在线观看在线视频| 欧美电影免费观看高清完整版在线观看| 日韩一区中文字幕| 国产久卡久卡久卡久卡视频精品| 欧美日韩国产123区|