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

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

?? nasmdoc9.htm

?? nasm手冊 大家可以看看 對要寫匯編程序的幫助很大
?? HTM
字號:
<html><head><title>NASM Manual</title></head><body><h1 align=center>The Netwide Assembler: NASM</h1><p align=center><a href="nasmdo10.html">Next Chapter</a> |<a href="nasmdoc8.html">Previous Chapter</a> |<a href="nasmdoc0.html">Contents</a> |<a href="nasmdoci.html">Index</a><h2><a name="chapter-9">Chapter 9: Mixing 16 and 32 Bit Code</a></h2><p>This chapter tries to cover some of the issues, largely related tounusual forms of addressing and jump instructions, encountered when writingoperating system code such as protected-mode initialisation routines, whichrequire code that operates in mixed segment sizes, such as code in a 16-bitsegment trying to modify data in a 32-bit one, or jumps betweendifferent-size segments.<h3><a name="section-9.1">9.1 Mixed-Size Jumps</a></h3><p>The most common form of mixed-size instruction is the one used whenwriting a 32-bit OS: having done your setup in 16-bit mode, such as loadingthe kernel, you then have to boot it by switching into protected mode andjumping to the 32-bit kernel start address. In a fully 32-bit OS, thistends to be the <em>only</em> mixed-size instruction you need, sinceeverything before it can be done in pure 16-bit code, and everything afterit can be pure 32-bit.<p>This jump must specify a 48-bit far address, since the target segment isa 32-bit one. However, it must be assembled in a 16-bit segment, so justcoding, for example,<p><pre>        jmp     0x1234:0x56789ABC       ; wrong!</pre><p>will not work, since the offset part of the address will be truncated to<code><nobr>0x9ABC</nobr></code> and the jump will be an ordinary 16-bitfar one.<p>The Linux kernel setup code gets round the inability of<code><nobr>as86</nobr></code> to generate the required instruction bycoding it manually, using <code><nobr>DB</nobr></code> instructions. NASMcan go one better than that, by actually generating the right instructionitself. Here's how to do it right:<p><pre>        jmp     dword 0x1234:0x56789ABC         ; right</pre><p>The <code><nobr>DWORD</nobr></code> prefix (strictly speaking, it shouldcome <em>after</em> the colon, since it is declaring the <em>offset</em>field to be a doubleword; but NASM will accept either form, since both areunambiguous) forces the offset part to be treated as far, in the assumptionthat you are deliberately writing a jump from a 16-bit segment to a 32-bitone.<p>You can do the reverse operation, jumping from a 32-bit segment to a16-bit one, by means of the <code><nobr>WORD</nobr></code> prefix:<p><pre>        jmp     word 0x8765:0x4321      ; 32 to 16 bit</pre><p>If the <code><nobr>WORD</nobr></code> prefix is specified in 16-bitmode, or the <code><nobr>DWORD</nobr></code> prefix in 32-bit mode, theywill be ignored, since each is explicitly forcing NASM into a mode it wasin anyway.<h3><a name="section-9.2">9.2 Addressing Between Different-Size Segments</a></h3><p>If your OS is mixed 16 and 32-bit, or if you are writing a DOS extender,you are likely to have to deal with some 16-bit segments and some 32-bitones. At some point, you will probably end up writing code in a 16-bitsegment which has to access data in a 32-bit segment, or vice versa.<p>If the data you are trying to access in a 32-bit segment lies within thefirst 64K of the segment, you may be able to get away with using anordinary 16-bit addressing operation for the purpose; but sooner or later,you will want to do 32-bit addressing from 16-bit mode.<p>The easiest way to do this is to make sure you use a register for theaddress, since any effective address containing a 32-bit register is forcedto be a 32-bit address. So you can do<p><pre>        mov     eax,offset_into_32_bit_segment_specified_by_fs         mov     dword [fs:eax],0x11223344</pre><p>This is fine, but slightly cumbersome (since it wastes an instructionand a register) if you already know the precise offset you are aiming at.The x86 architecture does allow 32-bit effective addresses to specifynothing but a 4-byte offset, so why shouldn't NASM be able to generate thebest instruction for the purpose?<p>It can. As in <a href="#section-9.1">section 9.1</a>, you need onlyprefix the address with the <code><nobr>DWORD</nobr></code> keyword, and itwill be forced to be a 32-bit address:<p><pre>        mov     dword [fs:dword my_offset],0x11223344</pre><p>Also as in <a href="#section-9.1">section 9.1</a>, NASM is not fussyabout whether the <code><nobr>DWORD</nobr></code> prefix comes before orafter the segment override, so arguably a nicer-looking way to code theabove instruction is<p><pre>        mov     dword [dword fs:my_offset],0x11223344</pre><p>Don't confuse the <code><nobr>DWORD</nobr></code> prefix<em>outside</em> the square brackets, which controls the size of the datastored at the address, with the one <code><nobr>inside</nobr></code> thesquare brackets which controls the length of the address itself. The twocan quite easily be different:<p><pre>        mov     word [dword 0x12345678],0x9ABC</pre><p>This moves 16 bits of data to an address specified by a 32-bit offset.<p>You can also specify <code><nobr>WORD</nobr></code> or<code><nobr>DWORD</nobr></code> prefixes along with the<code><nobr>FAR</nobr></code> prefix to indirect far jumps or calls. Forexample:<p><pre>        call    dword far [fs:word 0x4321]</pre><p>This instruction contains an address specified by a 16-bit offset; itloads a 48-bit far pointer from that (16-bit segment and 32-bit offset),and calls that address.<h3><a name="section-9.3">9.3 Other Mixed-Size Instructions</a></h3><p>The other way you might want to access data might be using the stringinstructions (<code><nobr>LODSx</nobr></code>,<code><nobr>STOSx</nobr></code> and so on) or the<code><nobr>XLATB</nobr></code> instruction. These instructions, since theytake no parameters, might seem to have no easy way to make them perform32-bit addressing when assembled in a 16-bit segment.<p>This is the purpose of NASM's <code><nobr>a16</nobr></code> and<code><nobr>a32</nobr></code> prefixes. If you are coding<code><nobr>LODSB</nobr></code> in a 16-bit segment but it is supposed tobe accessing a string in a 32-bit segment, you should load the desiredaddress into <code><nobr>ESI</nobr></code> and then code<p><pre>        a32     lodsb</pre><p>The prefix forces the addressing size to 32 bits, meaning that<code><nobr>LODSB</nobr></code> loads from<code><nobr>[DS:ESI]</nobr></code> instead of<code><nobr>[DS:SI]</nobr></code>. To access a string in a 16-bit segmentwhen coding in a 32-bit one, the corresponding<code><nobr>a16</nobr></code> prefix can be used.<p>The <code><nobr>a16</nobr></code> and <code><nobr>a32</nobr></code>prefixes can be applied to any instruction in NASM's instruction table, butmost of them can generate all the useful forms without them. The prefixesare necessary only for instructions with implicit addressing:<code><nobr>CMPSx</nobr></code>(<a href="nasmdocb.html#section-B.4.27">section B.4.27</a>),<code><nobr>SCASx</nobr></code>(<a href="nasmdocb.html#section-B.4.286">section B.4.286</a>),<code><nobr>LODSx</nobr></code>(<a href="nasmdocb.html#section-B.4.141">section B.4.141</a>),<code><nobr>STOSx</nobr></code>(<a href="nasmdocb.html#section-B.4.303">section B.4.303</a>),<code><nobr>MOVSx</nobr></code>(<a href="nasmdocb.html#section-B.4.178">section B.4.178</a>),<code><nobr>INSx</nobr></code>(<a href="nasmdocb.html#section-B.4.121">section B.4.121</a>),<code><nobr>OUTSx</nobr></code>(<a href="nasmdocb.html#section-B.4.195">section B.4.195</a>), and<code><nobr>XLATB</nobr></code>(<a href="nasmdocb.html#section-B.4.334">section B.4.334</a>). Also, thevarious push and pop instructions (<code><nobr>PUSHA</nobr></code> and<code><nobr>POPF</nobr></code> as well as the more usual<code><nobr>PUSH</nobr></code> and <code><nobr>POP</nobr></code>) canaccept <code><nobr>a16</nobr></code> or <code><nobr>a32</nobr></code>prefixes to force a particular one of <code><nobr>SP</nobr></code> or<code><nobr>ESP</nobr></code> to be used as a stack pointer, in case thestack segment in use is a different size from the code segment.<p><code><nobr>PUSH</nobr></code> and <code><nobr>POP</nobr></code>, whenapplied to segment registers in 32-bit mode, also have the slightly oddbehaviour that they push and pop 4 bytes at a time, of which the top twoare ignored and the bottom two give the value of the segment register beingmanipulated. To force the 16-bit behaviour of segment-register push and popinstructions, you can use the operand-size prefix<code><nobr>o16</nobr></code>:<p><pre>        o16 push    ss         o16 push    ds</pre><p>This code saves a doubleword of stack space by fitting two segmentregisters into the space which would normally be consumed by pushing one.<p>(You can also use the <code><nobr>o32</nobr></code> prefix to force the32-bit behaviour when in 16-bit mode, but this seems less useful.)<p align=center><a href="nasmdo10.html">Next Chapter</a> |<a href="nasmdoc8.html">Previous Chapter</a> |<a href="nasmdoc0.html">Contents</a> |<a href="nasmdoci.html">Index</a></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区三区四区| 日韩一级视频免费观看在线| 欧美日韩在线播放| 久久久久国产精品人| 亚洲电影激情视频网站| 岛国一区二区三区| 日韩亚洲欧美一区| 亚洲成人免费在线| 91免费看片在线观看| 欧美国产精品专区| 久久99国内精品| 91麻豆精品久久久久蜜臀| 一区二区三区精品视频在线| 成人av电影在线| 国产午夜精品久久久久久免费视| 亚洲午夜三级在线| 色久优优欧美色久优优| 自拍偷在线精品自拍偷无码专区| 国产乱码精品一品二品| 精品国产91乱码一区二区三区| 首页综合国产亚洲丝袜| 在线亚洲欧美专区二区| 日韩美女视频一区二区| 99久久综合精品| 国产精品久久久一区麻豆最新章节| 国产精品综合视频| 欧美电视剧在线看免费| 六月丁香婷婷色狠狠久久| 日韩一区二区视频在线观看| 首页国产丝袜综合| 亚洲成人精品影院| 久久精品99国产精品日本| 欧美色大人视频| 丝袜诱惑亚洲看片| 日韩一区二区三区视频| 日本美女一区二区三区| 欧美一区二区二区| 久久66热re国产| 久久精品视频在线免费观看| 成人免费毛片高清视频| 最新热久久免费视频| 91欧美一区二区| 亚洲亚洲人成综合网络| 宅男噜噜噜66一区二区66| 看国产成人h片视频| 久久一区二区视频| 成人aaaa免费全部观看| 亚洲日本va午夜在线影院| 91传媒视频在线播放| 午夜精品久久久久久久99樱桃 | 亚洲国产欧美日韩另类综合| 欧美午夜精品久久久久久孕妇 | 国产传媒一区在线| 亚洲视频网在线直播| 欧美老年两性高潮| 韩国三级中文字幕hd久久精品| 中文av一区特黄| 欧美日韩黄视频| 加勒比av一区二区| 亚洲卡通欧美制服中文| 欧美一区二区久久久| 成人a级免费电影| 亚洲成av人综合在线观看| 亚洲精品在线三区| 91免费版在线| 精品一区在线看| 亚洲视频 欧洲视频| 日韩亚洲欧美综合| 色狠狠av一区二区三区| 日本中文在线一区| 日韩理论片一区二区| 日韩精品在线一区| 91福利在线播放| 国产乱码精品一区二区三区忘忧草 | 亚洲三级电影全部在线观看高清| 欧美三级一区二区| 国产91对白在线观看九色| 亚洲韩国一区二区三区| 国产欧美一区二区三区网站 | 老司机精品视频在线| 亚洲精品午夜久久久| 国产午夜精品一区二区三区四区| 亚洲成人免费视频| 欧美性猛交一区二区三区精品| 国产精品一区三区| 日本午夜一本久久久综合| 一区二区三区在线不卡| 国产欧美日韩精品一区| 精品乱码亚洲一区二区不卡| 欧美色大人视频| 91免费小视频| 成人黄色777网| 精品一二三四区| 免费久久99精品国产| 亚洲成人精品一区| 亚洲欧美日韩在线| 国产精品人妖ts系列视频| 久久亚洲一区二区三区四区| 欧美另类videos死尸| 欧美在线免费观看亚洲| 91免费版在线| 91老司机福利 在线| av一区二区三区| 成人激情黄色小说| 国产伦精品一区二区三区视频青涩| 视频一区二区三区入口| 无吗不卡中文字幕| 午夜国产精品一区| 偷拍一区二区三区四区| 午夜成人在线视频| 日韩成人dvd| 美女任你摸久久| 久久国产精品色婷婷| 激情综合色播激情啊| 久久99精品久久久久久动态图| 奇米一区二区三区av| 日本中文字幕一区| 蜜桃av噜噜一区| 国产精品一级在线| 成人精品免费看| 91亚洲男人天堂| 欧美在线免费观看亚洲| 911精品产国品一二三产区| 欧美区在线观看| 日韩免费高清电影| 久久精品一区二区三区不卡| 亚洲国产高清aⅴ视频| 国产精品网站导航| 亚洲黄色性网站| 天天色综合天天| 国产一区91精品张津瑜| 北条麻妃一区二区三区| 欧美系列日韩一区| 久久综合狠狠综合久久激情| 国产精品欧美极品| 亚洲成人7777| 激情综合亚洲精品| 97se亚洲国产综合自在线不卡| 欧美日韩和欧美的一区二区| 欧美一区二区三区影视| 久久久久成人黄色影片| 亚洲色图欧洲色图| 老司机免费视频一区二区| www.欧美亚洲| 91精品久久久久久蜜臀| 欧美激情一区不卡| 五月激情综合色| 成人午夜免费av| 欧美精品aⅴ在线视频| 欧美—级在线免费片| 性做久久久久久久免费看| 国产成人在线电影| 欧美日韩日日骚| 中文字幕不卡在线| 日本不卡一二三区黄网| 成人app软件下载大全免费| 7777精品伊人久久久大香线蕉 | 国产视频不卡一区| 亚洲高清不卡在线| 成人v精品蜜桃久久一区| 91精品国产综合久久久久久| 国产欧美一区二区精品久导航| 亚洲一区二区成人在线观看| 国产一区二区免费看| 欧美美女喷水视频| 亚洲色图一区二区| 国产成人av网站| 日韩视频一区二区| 午夜久久久久久久久| 9色porny自拍视频一区二区| 欧美v国产在线一区二区三区| 亚洲蜜臀av乱码久久精品| 国产ts人妖一区二区| 欧美一级片在线看| 婷婷六月综合网| 在线免费观看日韩欧美| 亚洲欧洲另类国产综合| 国产激情一区二区三区| 欧美精品一区男女天堂| 日本强好片久久久久久aaa| 欧美性做爰猛烈叫床潮| 亚洲美女屁股眼交3| 99久久国产免费看| 一区精品在线播放| 成人黄色777网| 国产精品色哟哟网站| 国产成人免费9x9x人网站视频| 日韩精品一区二区三区四区视频| 午夜精品在线视频一区| 欧美日韩国产在线观看| 亚洲第一精品在线| 欧美视频在线播放| 亚洲超碰精品一区二区| 欧美亚洲另类激情小说| 亚洲国产人成综合网站| 欧美片网站yy| 另类调教123区| 久久综合久色欧美综合狠狠| 精品一区二区免费视频| 久久午夜国产精品|