2013微機實驗報告匯總(武漢大學物理學院)_第1頁
2013微機實驗報告匯總(武漢大學物理學院)_第2頁
2013微機實驗報告匯總(武漢大學物理學院)_第3頁
2013微機實驗報告匯總(武漢大學物理學院)_第4頁
2013微機實驗報告匯總(武漢大學物理學院)_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

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. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論