|
[求助]求助,看正文,错误中隐含着正确
知道错哪里,忘了一个终止循环的条件. |
|
[求助]求助,看正文,错误中隐含着正确
assume cs:code,ds:data,es:table data segment db '1975','1976','1977','1978','1979','1980','1981','1982','1983' db '1984','1985','1986','1987','1988','1989','1990','1991','1992' db '1993','1994','1995' dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514 dd 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000 dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226 dw 11542,14430,45257,17800 data ends stack segment dw 16 dup (0) stack ends table segment db 21 dup ('year summ ne ?? ') table ends code segment start: mov ax,data mov ds,ax mov ax,table mov es,ax mov cx,21 mov bx,0 mov di,0 mov si,0 s:mov ax,ds:0h[bx] mov dx,ds:2h[bx] mov es:[si].0h,ax mov es:[si].2h,dx mov ax,ds:54h[bx] mov dx,ds:56h[bx] mov es:[si].5h,ax mov es:[si].7h,dx mov ax,ds:0a8h[di] mov es:[si].0ah,ax mov ax,ds:54h[bx] div word ptr es:[si].0ah mov es:[si].0dh,ax add bx,4 add si,16 add di,2 loop s ;********************* ;* ;*进行转换字符并且送入显存区域中 ;* ;********************* mov ax,stack mov ss,ax mov sp,32 mov ax,table mov es,ax; 存在数据的段地址 mov ax,0b800h mov ds,ax; 显示区域的段地址处 mov cx,21 mov si,0;每次增加16,控制数据table mov di,0;每次增加160,控制显存区域中的行 mov bp,30 mov bx,2; push bx;栈中单元30与31为2,作为颜色 zxh:mov sp,bp push cx;将循环次数入栈28与29存储循环次数 mov bx,0 push bx;栈中单元26与27个单元保持为0作为取数据时的结束条件 ;******数据每一行的前4个单元为字符,无需转换,直接传入就可以 mov bl,2 mov ax,es:[si] mov [di],al mov [di+1],bl mov [di+2],ah mov [di+3],bl mov ax,es:[si+2] mov [di+4],al mov [di+5],bl mov [di+6],ah mov [di+7],bl ;********************** ;*di+偶数写字符值,,+奇数写颜色值2 ;*进行32位数的字符转换(收入栏) ;* ;********************** mov ax,0 mov dx,0 mov bx,0 mov cx,10;作为除数使用 mov ax,es:[si+5] mov dx,es:[si+7] s0:push ax;先将低为入栈 mov ax,dx mov dx,0 div cx mov bx,ax;暂存高16位数除10的商 pop ax div cx;使用先前dx/10的余数作为高16位,与出栈的ax除10 mov cx,dx;保存余数 mov dx,bx;此处还原高16位,此时商为dx(h)ax(l),余数存放在bx中 mov bx,cx;将余数附给bx,因为之后需要使用到cx mov cx,dx jcxz pds1;判断商,先判断高位,如果为0就跳到pds1处 ruzhan:add bx,30h;如果高16为不为0,说明商不会为0,则将cx加30h转为字符,如果为0,以下不执行,到pds1标号出执行 mov bh,2;bl为字符,bh保存颜色,然后入栈 push bx mov cx,11;重新设置cx为除数10,这里设置为11是因为loop会减1. loop s0; pds1:mov cx,ax;如果高位为0,继续判断低16位的值是否为0,以确保商最后为0 jcxz z;如果ax也为0,则说明商的确为0,跳转到 取数据 处,然后进行出栈到显存中 ;如果商不为0,进行余数加30入栈 inc cx;如果商为一,下面的指令会减去1,则成为0就无法计算最后一个商为1的数. loop ruzhan;进行入栈 z:add bx,30h mov bh,2 push bx mov bx,12 qsj:pop cx jcxz ren;如果取到先前入栈的0,则不再 mov word ptr [di+bx],cx;从栈中取数据放入显存中 add bx,2 loop qsj ;****************************** ;* ;*以下进行转换人数 ;* ;****************************** ren:mov ax,0;取出栈中数据后,在进行下一组的转换与入栈出栈操作 push ax;作为新一组取栈中数据时的结束条件 ;*************-------------******************** mov cx,10;作为除数使用 mov ax,es:[si+10] mov dx,0 r0:push ax;先将低为入栈 mov ax,dx mov dx,0 div cx mov bx,ax;暂存高16位数除10的商 pop ax div cx;使用先前dx/10的余数作为高16位,与出栈的ax除10 mov cx,dx;保存余数 0ba9:0102 mov dx,bx;此处还原高16位,此时商为dx(h)ax(l),余数存放在bx中 mov bx,cx;将余数附给bx,因为之后需要使用到cx mov cx,dx jcxz pds2;判断商,先判断高位,如果为0就跳到pds1处 ruzhan1:add bx,30h;如果高16为不为0,说明商不会为0,则将cx加30h转为字符,如果为0,以下不执行,到pds1标号出执行 mov bh,2;bl为字符,bh保存颜色,然后入栈 push bx mov cx,11;重新设置cx为除数10,这里设置为11是因为loop会减1. loop r0; pds2:mov cx,ax;如果高位为0,继续判断低16位的值是否为0,以确保商最后为0 jcxz z1;如果ax也为0,则说明商的确为0,跳转到 取数据 处,然后进行出栈到显存中 ;如果商不为0,进行余数加30入栈 inc cx;如果商为一,下面的指令会减去1,则成为0就无法计算最后一个商为1的数. loop ruzhan1;进行入栈 z1:add bx,30h mov bh,2 push bx mov bx,28 qsj2:pop cx jcxz null;如果取到先前入栈的0,则不再 mov word ptr [di+bx],cx;从栈中取数据放入显存中 add bx,2 loop qsj2 ;*************-------------******************** ;以下代码是做最后循环时用的 null:add si,16 add di,160 pop cx sub cx,1 call zxh mov ax,4c00h int 21h code ends end start |
|
[求助]帮忙看看怎么回事啊,有图
我跟踪了一遍,找到原因了,已经改正了,结贴吧、、、 |
|
[求助]帮忙看看怎么回事啊,有图
assume cs:code,ds:data,es:table data segment db '1975','1976','1977','1978','1979','1980','1981','1982','1983' db '1984','1985','1986','1987','1988','1989','1990','1991','1992' db '1993','1994','1995' dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514 dd 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000 dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226 dw 11542,14430,45257,17800 data ends stack segment dw 16 dup (0) stack ends table segment db 21 dup ('year summ ne ?? ') table ends code segment start: mov ax,data mov ds,ax mov ax,table mov es,ax mov cx,21 mov bx,0 mov di,0 mov si,0 s:mov ax,ds:0h[bx] mov dx,ds:2h[bx] mov es:[si].0h,ax mov es:[si].2h,dx mov ax,ds:54h[bx] mov dx,ds:56h[bx] mov es:[si].5h,ax mov es:[si].7h,dx mov ax,ds:0a8h[di] mov es:[si].0ah,ax mov ax,ds:54h[bx] div word ptr es:[si].0ah mov es:[si].0dh,ax add bx,4 add si,16 add di,2 loop s ;********************* ;* ;*进行转换字符并且送入显存区域中 ;* ;********************* mov ax,stack mov ss,ax mov sp,32 mov ax,table mov es,ax; 存在数据的段地址 mov ax,0b800h mov ds,ax; 显示区域的段地址处 mov cx,21 mov si,0;每次增加16,控制数据table mov di,0;每次增加160,控制显存区域中的行 mov bp,30 mov bx,2; 真正循环处,每行都显示有此处控制 push bx;栈中单元30与31为2,作为颜色 zxh:push cx;将循环次数入栈28与29存储循环次数 mov bx,0 push bx;栈中单元26与27个单元保持为0作为取数据时的结束条件 ;******数据每一行的前4个单元为字符,无需转换,直接传入就可以 mov bl,2 mov ax,es:[si] mov [di],al mov [di+1],bl mov [di+2],ah mov [di+3],bl mov ax,es:[si+2] mov [di+4],al mov [di+5],bl mov [di+6],ah mov [di+7],bl ;********************** ;*di+偶数写字符值,,+奇数写颜色值2 ;*进行32位数的字符转换(收入栏) ;* ;********************** mov ax,0 mov dx,0 mov bx,0 mov cx,10;作为除数使用 mov ax,es:[si+5] mov dx,es:[si+7] s0:push ax;先将低为入栈 mov ax,dx mov dx,0 div cx mov bx,ax;暂存高16位数除10的商 pop ax div cx;使用先前dx/10的余数作为高16位,与出栈的ax除10 mov cx,dx;保存余数 mov dx,bx;此处还原高16位,此时商为dx(h)ax(l),余数存放在bx中 mov bx,cx;将余数附给bx,因为之后需要使用到cx mov cx,dx jcxz pds1;判断商,先判断高位,如果为0就跳到pds1处 ruzhan:add bx,30h;如果高16为不为0,说明商不会为0,则将cx加30h转为字符,如果为0,以下2句不执行,到pds1标号出执行 mov bh,2;bl为字符,bh保存颜色,然后入栈 push bx mov cx,10;重新设置cx为除数10 loop s0; pds1:mov cx,ax;如果高位为0,继续判断低16位的值是否为0,以确保商最后为0 jcxz z;如果ax也为0,则说明商的确为0,跳转到 取数据 处,然后进行出栈到显存中 ;如果商不为0,进行余数加30入栈 loop ruzhan;进行入栈 z:add bx,30h mov bh,2 push bx mov bx,12 qsj:pop cx mov [di+bx],cx;从栈中取数据放入显存中 add bx,2 loop qsj add si,16 add di,160 pop cx loop zxh mov ax,4c00h int 21h code ends end start |
|
[求助]帮忙看看怎么回事啊,有图
pop在循环中使用过,所以足够取出入栈的所有数据,而且有一个push其实有没有都无所谓,并不影响,所以我就没有删除。 不过还是谢谢了。 希望可以有人帮着测试一下,目前我已经陷入小巷思维当中,怎么看都是正确的,太无奈了。 |
|
请问多少等级才可以进看雪FTP
灌水不会被封号吧??? |
|
|
|
[求助]程序错在哪,帮忙看看。
不是传说中的,是基础的汇编。。。。 |
|
[求助]帮忙看看我错在哪里
是啊。。。。。。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值