﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-跟汇编携手到老！-文章分类-ASM</title><link>http://www.cnitblog.com/tmat0305/category/4424.html</link><description>在学习与实践中进步。</description><language>zh-cn</language><lastBuildDate>Fri, 30 Sep 2011 02:49:37 GMT</lastBuildDate><pubDate>Fri, 30 Sep 2011 02:49:37 GMT</pubDate><ttl>60</ttl><item><title>我的第4个Win32汇编程序</title><link>http://www.cnitblog.com/tmat0305/articles/20315.html</link><dc:creator>仰望宁静的星空!</dc:creator><author>仰望宁静的星空!</author><pubDate>Sun, 10 Dec 2006 04:11:00 GMT</pubDate><guid>http://www.cnitblog.com/tmat0305/articles/20315.html</guid><wfw:comment>http://www.cnitblog.com/tmat0305/comments/20315.html</wfw:comment><comments>http://www.cnitblog.com/tmat0305/articles/20315.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/tmat0305/comments/commentRss/20315.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/tmat0305/services/trackbacks/20315.html</trackback:ping><description><![CDATA[
		<p>
				<strong>.386<br />.model flat, stdcall<br />option casemap : none<br />includelib msvcrt.lib</strong>
		</p>
		<p>
				<strong>printf    PROTO C :dword, :vararg</strong>
		</p>
		<p>
				<strong>.data<br />printResult   byte    'result is % d, loop tot is %d', 0ah, 0</strong>
		</p>
		<p>
				<strong>.code<br />start    proc<br />     push    eax<br />     push    ebx<br />     push    ecx<br />     push    edi<br />     push    esi<br />     xor     esi,    esi<br />     mov     ebx,    16<br />     mov     ecx,    10<br />a10:<br />     inc     esi<br />     mov     eax,    ebx<br />     mul     eax<br />     mov     edi,    eax<br />     mov     eax,    ecx<br />     mul     ecx<br />     sub     edi,    eax<br />     cmp     edi,    168<br />     jb     addEbx<br />     ja     addEcx<br />     sub     eax,    100<br />     jmp     showResult<br />addEbx:<br />     inc     ebx<br />     jmp     a10<br />addEcx:<br />     inc     ecx<br />     jmp     a10<br />showResult:<br />     invoke    printf,    offset printResult, eax, esi<br />     pop     eax<br />     pop     ebx<br />     pop     ecx<br />     pop     edi<br />     pop     esi<br />     ret<br />start    endp<br />end     start</strong>
		</p>
<img src ="http://www.cnitblog.com/tmat0305/aggbug/20315.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/tmat0305/" target="_blank">仰望宁静的星空!</a> 2006-12-10 12:11 <a href="http://www.cnitblog.com/tmat0305/articles/20315.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我的第3个win32汇编程序</title><link>http://www.cnitblog.com/tmat0305/articles/20314.html</link><dc:creator>仰望宁静的星空!</dc:creator><author>仰望宁静的星空!</author><pubDate>Sun, 10 Dec 2006 04:10:00 GMT</pubDate><guid>http://www.cnitblog.com/tmat0305/articles/20314.html</guid><wfw:comment>http://www.cnitblog.com/tmat0305/comments/20314.html</wfw:comment><comments>http://www.cnitblog.com/tmat0305/articles/20314.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/tmat0305/comments/commentRss/20314.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/tmat0305/services/trackbacks/20314.html</trackback:ping><description><![CDATA[
		<p>
				<strong>.386<br />.model flat, stdcall<br />option casemap : none<br />includelib msvcrt.lib</strong>
		</p>
		<p>
				<strong>printf    PROTO C :dword, :vararg</strong>
		</p>
		<p>
				<strong>.data<br />showNum    byte    '%d', 0<br />newLine    byte    0ah, 0<br />iArray    dword    1, 2, 3, 4<br />COUNT    EQU     ($ - iArray) / 4</strong>
		</p>
		<p>
				<strong>.code<br />start    proc<br />     push    ebx<br />     push    esi<br />     push    eax<br />     <br />     mov     esi,    0<br />     mov     ebx,    esp<br />L1:     <br />     push    esi<br />     cmp     esi,    COUNT<br />     jz     endShow<br />     xor     esi,    esi<br />L2: <br />     cmp     [ebx - 4],   esi<br />     jz     addEsiL1<br />     push    esi<br />     xor     esi,    esi<br />L3:<br />     cmp     [ebx - 4],   esi<br />     jz     addEsiL2<br />     cmp     [ebx - 8],   esi<br />     jz     addEsiL2<br />     mov     eax,    [ebx - 4]<br />     mov     eax,    iArray[eax * 4]<br />     invoke    printf,    offset showNum, eax <br />     mov     eax,    [ebx - 8]<br />     mov     eax,    iArray[eax * 4]<br />     invoke    printf,    offset showNum, eax <br />     mov     eax,    iArray[esi * 4]<br />     invoke    printf,    offset showNum, eax<br />     invoke    printf,    offset newLine      <br />     inc     esi<br />     cmp     esi,    COUNT<br />     jnz     L3<br />     pop     esi<br />     inc     esi<br />     jmp     L2     <br />addEsiL1:    <br />     inc     esi<br />     cmp     esi,    COUNT<br />     jnz     L2<br />     jmp     resetL1<br />addEsiL2:    <br />     inc     esi<br />     cmp     esi,    COUNT<br />     jnz     L3<br />     jmp     resetL2<br />resetL1:    <br />     pop     esi<br />     inc     esi<br />     cmp     esi,    COUNT<br />     jz     endShow<br />     jmp     L1<br />resetL2:    <br />     pop     esi<br />     inc     esi<br />     cmp     esi,    COUNT<br />     jz     resetL1<br />     jmp     L2<br />endShow:<br />     pop     eax<br />     pop     esi<br />     pop     ebx<br />     ret<br />start    endp<br />end     start</strong>
		</p>
<img src ="http://www.cnitblog.com/tmat0305/aggbug/20314.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/tmat0305/" target="_blank">仰望宁静的星空!</a> 2006-12-10 12:10 <a href="http://www.cnitblog.com/tmat0305/articles/20314.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我的第2个win32汇编程序</title><link>http://www.cnitblog.com/tmat0305/articles/20313.html</link><dc:creator>仰望宁静的星空!</dc:creator><author>仰望宁静的星空!</author><pubDate>Sun, 10 Dec 2006 04:09:00 GMT</pubDate><guid>http://www.cnitblog.com/tmat0305/articles/20313.html</guid><wfw:comment>http://www.cnitblog.com/tmat0305/comments/20313.html</wfw:comment><comments>http://www.cnitblog.com/tmat0305/articles/20313.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/tmat0305/comments/commentRss/20313.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/tmat0305/services/trackbacks/20313.html</trackback:ping><description><![CDATA[
		<p>
				<strong>.386<br />.model flat, stdcall<br />option casemap : none<br />includelib msvcrt.lib</strong>
		</p>
		<p>
				<strong>printf   PROTO C :dword, :vararg<br />scanf   PROTO C :dword, :vararg</strong>
		</p>
		<p>
				<strong>.data<br />outputStart  byte   'input ten num', 0ah, 0<br />outputCount  byte   'input the %d num', 0ah, 0<br />input   byte   '%d', 0<br />outputResult byte   'the max num is %d', 0ah, 0<br />iArray   dword   5 dup (?) </strong>
		</p>
		<p>
				<strong>.code<br />start   proc<br />    mov    ebx,   offset iArray<br />    mov    ecx,   5<br />    xor    esi,   esi<br />startInput:                 <br />    invoke   printf,   offset outputCount, esi<br />    invoke   scanf,   offset input, ebx<br />    add    ebx,   4<br />    inc    esi<br />    cmp    esi,   5<br />    jnz    startInput<br />    <br />    mov    esi,   1<br />    mov    eax,   dword ptr iArray<br />    mov    ebx,   offset iArray<br />getMax:<br />    cmp    eax,   dword ptr [ebx + esi * 4]  <br />    jl    updateMax<br />    inc    esi<br />    cmp    esi,   5<br />    jz    output<br />    jmp    getMax<br />updateMax:  <br />    mov    eax,   dword ptr [ebx + esi * 4]<br />    inc    esi<br />    cmp    esi,   5<br />    jnz    getMax<br />output:<br />    invoke   printf,   offset outputResult, eax<br />    ret<br />start   endp<br />end    start  </strong>
		</p>
<img src ="http://www.cnitblog.com/tmat0305/aggbug/20313.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/tmat0305/" target="_blank">仰望宁静的星空!</a> 2006-12-10 12:09 <a href="http://www.cnitblog.com/tmat0305/articles/20313.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我的第一个win32汇编程序</title><link>http://www.cnitblog.com/tmat0305/articles/20312.html</link><dc:creator>仰望宁静的星空!</dc:creator><author>仰望宁静的星空!</author><pubDate>Sun, 10 Dec 2006 04:07:00 GMT</pubDate><guid>http://www.cnitblog.com/tmat0305/articles/20312.html</guid><wfw:comment>http://www.cnitblog.com/tmat0305/comments/20312.html</wfw:comment><comments>http://www.cnitblog.com/tmat0305/articles/20312.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/tmat0305/comments/commentRss/20312.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/tmat0305/services/trackbacks/20312.html</trackback:ping><description><![CDATA[
		<p>
				<strong>.386<br />.model flat, stdcall<br />option casemap : none<br />includelib msvcrt.lib</strong>
		</p>
		<p>
				<strong>printf   PROTO C :dword, :dword</strong>
		</p>
		<p>
				<strong>.data<br />result   byte   'the result is %d', 0ah, 0</strong>
		</p>
		<p>
				<strong>.code<br />start   proc<br />    mov    ecx,   100<br />    xor    eax,   eax<br />addNum:  <br />    add    eax,   ecx<br />    loop   addNum<br />    invoke   printf, offset result, eax<br />    ret<br />start   endp<br />end    start</strong>
		</p>
<img src ="http://www.cnitblog.com/tmat0305/aggbug/20312.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/tmat0305/" target="_blank">仰望宁静的星空!</a> 2006-12-10 12:07 <a href="http://www.cnitblog.com/tmat0305/articles/20312.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>