版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 20113012300191 s=1+2+3+6+n<=100ns2 nsumtd 16max n=xxh sum =xxh34filename:zengrui.asm data segmentn db? ; mesg1 dbmax n=,30h,30h,h,$ sum db?mesg2 dbsum =,30h,30h,h,$ data endscode segmentasume cs:code,ds:data ;begin: mov ax,data ;ds mov ds,axmov bl,0 ;blal0 mov al,0count: incbl add al,bl cmp al,1
2、00jbecount ;<=subal,bl ;al100bl decbl ;bl mov n,bl ;n mov sum,al ;sum mov bx,offset ncall n2_16 ;n2_16 mov bx,offset sumcall n2_16mov ah,9 ;9mov dx,offset mesg1int 21hmov ah,02h;2mov dl,00hint 21hmov ah,02hmov dl,00hint 21hmov ah,9 ;9mov dx,offset mesg2int21hmov ah,4ch;dosint21hn2_16 procnexti: c
3、mp byte ptr bx,16;16 jc next2 ;16 sub byte ptr bx,16;16 inc byte ptr bx+7 ; jmp next1next2 mov ah,byte ptr bxcmp ah,10 ;10 jc next3 ;10 mov ch,7 ;7 add ah,chnext3 add byte ptr bx+8,ah ; ret endpcode endsend begin5max n=0dh sum =5bh 2datasegment mesg1 dbmax n=,30h,30h,h,$mesg1 dbmax n=,30h,30h,h,00h,
4、00h,$ max n=xxh sum =xxhmax n=0dh sum =5bh,sumn2_16sum<=1001610107ascii16aascii41h7ascii3ah216162160f0h0fhn2_16 procmov al,byte ptr bxmov ah,aland al,0f0h ;al0 mov cl,4 ;shr al,clcmp al,10jc next1add al,7next1: add byte ptr bx+7,aland ah,0fh ;ah0cmp ah,10; jc next2add ah,7next2: add byte ptr bx+8
5、,ahretendp16 20113012300191,direct2(1) montabdb jan , feb , mar , apr , may , jun db jul , aug , sep , oct , nov , dec(2) montab + (-1) * 3ascii34filename zengrui.asmdata segmentmesg1 db please input the number for month,0dh,0ah,$ mesg2 db error!,0dh,0ah,$num db 3 count db ? ;store db 2 dup(?); mont
6、ab db jan , feb , mar , apr , may , jun;dbjul , aug , sep , oct , nov , decmonth db 3 dup(?),0dh,0ah,$ ;data ends code segmentassume cs:code,ds:data start: mov ax,datamov ds,axmov es,ax ;esds mov dx,offset mesg1 ; mov ah,09h int 21hmov dx,offset num ; mov ah,0ah int 21hcmp count,0 ;0 jzexit ;0 cmp c
7、ount,2 jznext mov xor mov jmp next: mov mov xor cmp jz cmp jnz sub add goon: cmp jz cmp jadec mov mul lea add lea mov cld rep disp: mov mov al,storeal,30h ah,0 goon ah,store al,store+1ax,3030hah,0goon ah,1last ah,ah al,10 al,0 last al,12 last al bl,3bl si,montabsi,ax di,month cx,3movsb dx,offset mon
8、th ah,09h;ascii ;ah ; ascii ;ah0 ;ah1 ;ascii ;0;12 ;al ; ;df ;int 21h; jmp start; last: mov dx,offset mesg2 ;error mov ah,09h int21h jmp startexit: mov ah,4ch; int21hcode ends end start5909012error0dh,0ah,$jan , 0dh,0ah,$?montab + (-1) * 6ascii30hal012esdsesdsds 20113012300191 n102n345;filename zeng
9、.asmdata segmentmesg1 db please input a number between 0 and 9,0dh,0ah,$ mesg2 db error message!,0dh,0ah,$ mesg3 db !=,$ store dw ? data endsstack segmentdb 256 dup(?)stack endscode segmentassume cs:code,ds:data,ss:stack main proc farstart: mov ax,datamov ds,axmov dx,offset mesg1;mov ah,09hint 21hmo
10、v ah,1int 21hcmp al,20h jzexitxor al,30h cmp al,0 jnz nextinc al next: cmp al,9 ja errorpush ax lea dx,mesg3mov ah,09hint 21h pop axcall calculcall printcall crlfjmp starterror: mov dx,offset mesg2 mov ah,09hint 21hjmp start exit: mov ah,4chint 21h main endpcalcul procmov ah,0mov cx,ax mov al,1mov d
11、x,0mov bx,0 again: inc bx; ; ;ascii ;al0 ;0 ;9 ;9;ax; ;cx ;ax1mul bxcmp bx,cxjnz again ;bxcxretcalcul endpprint procmov cx,0cmp dx,0;dx0 jz thenmov bx,10div bx push dx inc cx then: mov dx,0mov store,ax mov bx,10div bx push dx inc cx cmp dx,storejnz then display: pop dx add dl,30h mov ah,2 int 21h lo
12、op display ret print endpcrlf procmov dl,0dh mov ah,2 int 21h mov dl,0ah mov ah,2 int 21h ret crlf endp code endsend main;store ;cx ; ;dx;dlascii ;51please input a number between 0 and 9 0=1please input a number between 0 and 9 1=1please input a number between 0 and 9 2=2please input a number betwee
13、n 0 and 9 3=6please input a number between 0 and 9 4=24please input a number between 0 and 9 5=120please input a number between 0 and 9 6=720please input a number between 0 and 9 7=5040please input a number between 0 and 9 8=40320please input a number between 0 and 9 9=362880please input a number be
14、tween 0 and 9 h error messageherror message 2 int 21haxaxaxint 21hal24h0 18935200: again: mul cx loop againcx11-88=40320655359*8*?*3x0002haxc4c0hax2dx0001h,ax8980hax1dx0000h,ax8980h352001*2*3?*91*2*3?*9dx0005h,ax8980h,362880print10100001000?6=7206=00720 20113012300191 23bios45;filename
15、zz.asmwrite macro x,y1,y2 local ll,firstmov cx,x ;cx mov al,color ; mov bh,0mov dx,y1 ;dx jmpfirstll: incdx first: mov ah,0chint 10h cmpdx,y2 jnz ll endmdata segment r db ?r2 dw ? a db ?a2 dw ? h dw ? yy dw 240 xx dw 320color equ14 right dw ? left dw ? up dw ? down dw ?count db ? data ends code segm
16、entassume cs:code,ds:data start: mov ax ,data mov ds,axmov r,1 mov count,100call screen last: call draw call delayincr dec count jnzlastwaitin: mov ah,1 ; ; ;r ;a ; ; ; ; ;1 ; ;int21hmov ax,2 ;8025int10h mov ah,4chint21h ;doscalcul proc ;?= r mov al,amul almov a2,ax mov al,rmul alsub ax,a2 mov cx,0
17、last1: mov dx,cxadd dx,dx incdxsub ax,dxjc exit1 inccxjmp last1exit1: mov h,cx ret calcul endpdelay procmov ah,86hmov cx,0mov dx,10000int 15hret delay endpdraw proc mov a,0again: call calcul mov ch,0 mov cl,aadd cx,xx mov right,cx mov ch,0 mov cl,a negcx addcx,xx;a2 ;r2 ;axr2?a2 ;2k ;2k+1 ; ;cxh;10m
18、s;movleft,cx ;movdx,hadd dx,yymovdown,dx ;movdx,hneg dxadd dx,yymovup,dx ;write left,up,down ;write right,up,down ;inc amoval,rcmpa,al;ajnz againret draw endp code ends end start61dos 2 ?= r1+3+5+?+(2k+1) =k2c h2 ch2ch/8253 20113012300191825328253/600nn0fhout0n+1out0 6;filename zzz.asmcode segmentas
19、sume cs:codestart: mov al,10h ;:0mov dx,0cb03h ;out dx,al ;mov dx,0cb00h ;0mov al,0fh ;n=15out dx,al ;mov cl,al ;clcall displp: mov ah,0bhint 21hinc al;aljzexit ;exitinal,dx ;0cb00hcmp al,cl ;alcljzlp;lp call disp ;dec cl;cljmp lpexit: mov ah,4chint 21h ;dosdisp proc nearpush dxand al,0fh mov dl,alc
20、mp dl,9jlenum ;9num addal,7num: add dl,30hmov ah,02hint21h ;mov dl,0dhint21h ;mov dl,0ahint21h ;pop dxdisp endpcode endsend start(1)fed21fe.dos(2)1600fh,0ffh3clal4cpucpumov al,00h ;0mov dx,0cb03h;out dx,al ;mov dx,0cb00h;0in al,dx;08 cpu 20113012300191pc21pc8259cpuibmpcpc/xt82598 irq0 08h irq1 09h i
21、rq2 0ah irq3 obh 2irq4 0ch 1irq5 0dh irq6 0eh irq7 0fh 8irq0irq762isapc/at2868259irq2825916 irq8 070h irq9 071h irq10 072h irq11 073h irq12 074h irq13 075h irq14 076h irq15 077h pciinta#intb#intc#intd#p&p 8.1 28.1tpc pci card interrupt10; filename rr.asmdatasegmentcount db 10 ;10 mesgdb tpc pci card interrupt,0ah,0dh,$ ; dataends code segmentassume cs:code,ds:datastart: mov ax,datamov ds,axmov dx,0c400h+68h in ax,dx orax,0
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026吉林省高速公路集团有限公司长春分公司劳务派遣项目招聘5人备考题库及答案详解(真题汇编)
- 2026新疆塔城地区水务集团有限公司招聘37人备考题库及答案详解(名师系列)
- 2026华西九建公开招聘水利水电专业技术人才5人备考题库含答案详解(达标题)
- 2026江苏南京航空航天大学金城学院招聘备考题库 (学生工作处)有完整答案详解
- 2026江苏苏州大学科研助理岗位招聘7人备考题库及完整答案详解1套
- 2026浙江台州循环经济发展有限公司招聘6人备考题库含答案详解ab卷
- 2026广东阳江中职学校教师招聘9人备考题库含答案详解(基础题)
- 2026湖北荆州东宝区卫生健康局招聘3人备考题库含答案详解(基础题)
- 2026年民革中央所属在京单位招聘备考题库(5人)附答案详解(考试直接用)
- 2026广东广州市体育局直属事业单位第一次引进紧缺专业人才10人备考题库含答案详解(完整版)
- 购买课程服务合同协议
- 2024年河南高职单招职测模拟题库及答案解析(共100道试题)
- 小学一年级数学20以内进位、退位加减法口算
- 12 慧眼看交通 (说课稿)-统编版道德与法治三年级下册
- 2025(完整)钢结构合同范本
- 2025年汽车零部件企业公司组织架构图职能部门及工作职责
- 班主任-钉钉班级群邀请家长操作流程
- 《成人住院患者静脉血栓栓塞症风险评估技术》
- 个人房屋买卖合同范本复制
- 海尔电冰箱BCD-251WBSV使用说明书
- 辐射安全与防护知识考试题库及答案
评论
0/150
提交评论