标题:求大神解答,本人新手
只看楼主
qq284991936
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-11-22
 问题点数:0 回复次数:1 
求大神解答,本人新手
自学汇编,新手,刚写了一个自然数相减(0-1-2-3-……-N)的汇编,可是怎么都得不到正确答案,代码如下:
include io32.inc
    .data
    msg1  byte '-Max Sum= ',0
    msg2  byte '-Max Num= ',0
    .code
start:
    xor ebx,ebx    ;保存Sum
    xor ecx,ecx    ;保存Num
again:
    dec ecx
    mov edx,ebx    ;用于保存没溢出前的值
    add ebx,ecx
    jno again

    mov eax,offset msg1
    call dispmsg
    mov eax,edx
    call dispuid
    call dispcrlf

    mov eax,offset msg2
    call dispmsg
    ;inc ecx
    mov eax,ecx
    call dispuid
    exit 0
    end start
搜索更多相关主题的帖子: 自学 include 正确答案 自然数 
2012-11-22 16:22
qq284991936
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-11-22
得分:0 
有没有帮忙解答的,在此先谢谢了
2012-11-22 16:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-387952-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091031 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved