资源预览内容
第1页 / 共10页
第2页 / 共10页
第3页 / 共10页
第4页 / 共10页
第5页 / 共10页
第6页 / 共10页
第7页 / 共10页
第8页 / 共10页
第9页 / 共10页
第10页 / 共10页
亲,该文档总共10页全部预览完了,如果喜欢就下载吧!
资源描述
assume cs:code,ss:stack,ds:datastack segmentdw 16 dup (0)stack endsdata segmentdb 16 dup (0)db 1975,1976,1977,1978db 1979,1980,1981,1982db 1983,1984,1985,1986db 1987,1988,1989,1990db 1991,1992,1993,1994db 1995dd 16,22,382,1356dd 2390,8000,16000,24486dd 50065,97479,140417,197514dd 345980,590827,803530,1183000dd 1843000,2759000,3753000,4649000dd 5937000dw 3,7,9,13,28,38,130,220dw 476,778,1001,1442,2258,2793,4037,5635dw 8226,11542,14430,15257,17800data endstable segmentdb 21 dup (year summ ne ? )table endscode segmentstart:mov ax,stackmov ss,axmov sp,20hcall deal_data /处理数据call clean_disp /清屏call show_yearcall show_summcall show_necall show_wagemov ax,4c00hint 21hdeal_data:push dspush espush axpush bxpush cxpush sipush bpmov ax,datamov ds,axmov ax,tablemov es,axmov bp,0 mov cx,21 mov bx,0 s0:mov si,0 mov ax,10hbxmov es:bp+si,axmov ax,64hbxmov es:5hbp+si,axadd si,2add bx,2mov ax,10hbxmov es:bp+si,axmov ax,64hbxmov es:5hbp+si,axadd bx,2add bp,16loop s0mov bp,0mov cx,21mov bx,0s1:mov ax,0b8hbxmov es:0ahbp,axpush cxmov cx,axmov ax,es:5hbpmov dx,es:7hbpcall divdwmov es:0dhbp,axpop cxadd bx,2add bp,16loop s1pop bppop sipop cxpop bxpop axpop espop dsretdivdw:push bx /除法运算:所需参数 ax:被除数低 16 位 dx:被除数高 16 位 cx:16 位除 push si 数 返回: ax:结果低 16 位 dx:结果高 16 位 cx:余数mov bx,axmov si,cxmov ax,dxmov dx,0div cxmov cx,axmov ax,bxdiv simov si,dxmov dx,cxmov cx,sipop sipop bxretshow_str:push ds /需要提供 ds:显示字符所在内存的段 si:第一个字符的偏移地址push es dh:显示字符所在行 dl:第一个字符所在列 cl:字符属性push axpush bxpush cx push ush dipush simov ax,0b800h /显存初始段mov es,axmov al,0a0hmul dhmov bx,axmov dh,0add bx,dxadd bx,dxmov di,0mov dh,cldis:mov cl,simov ch,0jcxz okmov dl,clmov es:bx+di,dxinc siadd di,2jmp short disok:pop sipop dipop op cxpop bxpop axpop espop ds retclean_disp:push espush sipush cxmov cx,0b800hmov es,cxmov si,0mov cx,4e20hs2:mov word ptr es:si,0020hadd si,2loop s2pop cxpop sipop esretreset:push ds /输出缓冲区清零push cxpush simov cx,datamov ds,cxmov si,0mov cx,16s3:mov byte ptr si,0inc siloop s3pop sipop cxpop dsretinverted_order:push ds /输出缓冲区字符顺序倒置push axpush cxpush si push sppush bpmov cx,datamov ds,cxmov si,0mov cx,0mov ah,0mov bp,sps4: mov al,simov cl,aljcxz ok_1push axinc sijmp short s4 ok_1:mov si,0mov cx,0s5:mov cx,bpsub cx,spjcxz ok_2pop axmov si,alinc sijmp short s5ok_2:pop bppop sppop sipop cxpop axpop ds retdtoc:push ax /数值转化成字符串push cxpush simov si,0s6:mov cx,0ahcall divdwadd cl,30hmov si,clmov cx,axjcxz overinc sijmp short s6over: call inverted_orderpop sipop cxpop axretshow_value:push ds push bxpush cx push ush si call resetmov cx,datamov ds,cxcall dtocmov dh,bhmov dl,blmov cx,4mov si,0call show_strpop sipop dx pop cxpop bx pop dsretshow_year:push ds push ax push cxpush ush sipush dimov ax,tablemov ds,axmov cx,21mov si,0mov dh,1mov dl,1s7:mov byte ptr 4hsi,0push cxmov cl,4call show_strpop cxinc dhadd si,10hloop s7pop dipop sipop op cxpop axpop dsretshow_summ:push ds push axpush bxpush cxpush dx push simov ax,tablemov ds,axmov si,5hmov cx,21mov bh,1mov bl,10s8:mov ax,simov dx,2hsicall show_valueadd si,10hinc bhmov ax,tablemov ds,axloop s8pop si pop op cxpop bxpop ax pop dsretshow_ne:push ds push axpush bxpush cxpush dx push si mov ax,tablemov ds,axmov si,0ahmov cx,21mov bh,1mov bl,20s9:mov ax,simov dx,0call show_valueadd si,10hinc bhmov ax,tablemov ds,axloop s9pop si pop op cxpop bxpop ax pop dsretshow_wage:push ds push axpush bxpush cxpush dx push simov ax,tablemov ds,axmov si,0dhmov cx,21mov bh,1mov bl,30s10:mov ax,simov dx,0call show_valueadd si,10hinc bhmov ax,table mov ds,axloop s10pop si pop op cxpop bxpop ax pop dsretcode endsend start
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号