1、微机实验程序2.1data segmentlist db 10 dup (?)data endscode segment assume cs:code,ds:datastart:mov ax,data mov ds,ax mov bx,00h mov al,00h mov cx,09hnext:mov listbx,al inc bx inc al loop next mov ah,4ch int 21hcode ends end start2.2DATA SEGMENT X DB -78,127,-128,-125,88Y DB 32,-43,76,95,1S DB 5 DUP(?)DATA
2、 ENDSCODE SEGMENT ASSUME CS:CODE,DS:DATASTART:MOV AX,DATA MOV DS,AX MOV CX,5 MOV BX,0SUM:MOV AL,XBX ADD AL,YBX MOV SBX,AL INC BX LOOP SUM MOV AH,4CH INT 21HCODE ENDS END START2.3DATA SEGMENT X DB 67H,34H,12H,90H,57HY DB 68H,24H,90H,57H,13HS DB 5 DUP(?)DATA ENDSCODE SEGMENT ASSUME CS:CODE,DS:DATASTAR
3、T:MOV AX,DATA MOV DS,AX LEA SI,X LEA DI,Y LEA BX,S ADD BX,5 MOV CX,5LOOP1: MOV AL,SI ADC AL,DI DAA MOV BX,AL INC SI INC DI DEC BX LOOP LOOP1 MOV AH,4CH INT 21HCODE ENDS END START2.4DATA SEGMENT X DB 7,8,5,4,6,9,3,2,1DATA ENDSCODE SEGMENT ASSUME CS:CODE,DS:DATASTART:MOV AX,DATA MOV DS,AX MOV CX,8LOOP
4、1:MOV DX,CX MOV BX,0LOOP2: MOV AL,XBX CMP AL,XBX+1 JBE NO XCHG AL,XBX+1 MOV XBX,ALNO: INC BX LOOP LOOP2 MOV CX,DX LOOP LOOP1 MOV AH,4CH INT 21HCODE ENDS END START3.1data segmentx db 85,77,126,-1,-43,37,-128,11,-19,13data endsextra segmentcopy db 10 dup(?)extra endscode segment assume cs:code,ds:data
5、,es:extrastart: mov ax,data mov ds,ax mov ax,extra mov es,ax call sort call cop mov ah,4ch int 21hsort proc near mov cx,9loop1:mov dx,cx mov bx,0loop2:mov al,xbx cmp al,xbx+1 jng no xchg al,xbx+1 mov xbx,alno: inc bx loop loop2 mov cx,dx loop loop1 retsort endpcop proc near lea bx,x lea di,copy mov
6、cx,10loop3:mov al,bx mov es:di,al inc di inc bx loop loop3 retcop endp code ends end start4.12data segmentx db 5 dup(10)data endscode segment assume cs:code,ds:datastart: mov ax,data mov ds,ax mov cx,5 mov bx,0loop1: mov ah,01h int 21h push ax inc bx loop loop1 mov cx,5 mov bx,4loop3: pop ax mov xbx
7、,al dec bx loop loop3 mov dl,0dh mov ah,02h int 21h mov dl,0ah mov ah,02h int 21h mov cx,5 mov bx,0loop2: mov dl,xbx mov ah,02h int 21h inc bx loop loop2code ends end start4.34data segmentx db 50 db ?y db 50 dup(24H)data endscode segment assume cs:code,ds:datastart: mov ax,data mov ds,ax lea dx,x mo
8、v ah,0ah int 21h mov dl,0dh ;回车 mov ah,02h int 21h mov dl,0ah ;换行 mov ah,02h int 21h lea dx,y mov ah,09h int 21h 4.5code segment assume cs:codestart: MOV DL,35H MOV CX,5LOOP1: CALL DELAY MOV AH,02H INT 21H DEC DL LOOP LOOP1DELAY PROC NEAR PUSH CX MOV BX,2000HFOR1: MOV CX,2500HFOR2: LOOP FOR2 DEC BX
9、JNZ FOR1 POP CX RETDELAY ENDP code ends end start code ends end start 微机实验8data segmentx db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fhdata endscode segment assume cs:code,ds:datastart:mov ax,data mov ds,ax lea bx,x l2:mov cx,0ffh l1:mov dx,280h mov al,00h out dx,al mov dx,290h mov al,bx out dx,al mov d
10、x,280h mov al,02h out dx,al call delay mov dx,280h mov al,00h out dx,al mov dx,290h mov al,bx+1 out dx,al mov dx,280h mov al,01h out dx,al call delay loop l1 add bx,2 loop l2 mov dx,280hmov al,00hout dx,almov ah,4chint 21hdelay proc near push cx push bx mov bx,50h for1: mov cx,100h for2:loop for2 de
11、c bx jnz for1 pop bx pop cx ret delay endp code ends end start微机实验91code segment assume cs:codestart: mov al,10000000b mov dx,283h out dx,al mov cx,3 l1:mov dx,281h mov al,0ffh out dx,al call delay mov al,00h out dx,al call delay loop l1 mov ah,4ch int 21hdelay proc near push cx push bx mov bx,500hf
12、or1: mov cx,1500hfor2: loop for2 dec bx jnz for1 pop bx pop cx retdelay endpcode ends end start2code segment assume cs:codestart: mov al,10110100bmov dx,283hout dx,all1:mov dx,282h in al,dx and al,20h jz l1 mov dx,280h in al,dx call delay mov dx,281h out dx,all2:mov dx,282h in al,dx and al,02h jz l2
13、 mov dx,281h mov al,00h out dx,al mov ah,4ch int 21hdelay proc near push cx push bx mov bx,1500hfor1: mov cx,2500hfor2: loop for2 dec bx jnz for1 pop bx pop cx retdelay endpcode ends end start微机实验101code segment assume cs:codestart: mov al,00010000b mov dx,283h out dx,al mov dx,280h mov al,04h out d
14、x,al call delay mov dx,280h in al,dx mov dl,al add dl,30h mov ah,02h int 21h jmp start delay proc near push cx push bx mov bx,1500h for1:mov cx,0f500h for2:loop for2 dec bx jnz for1 pop bx pop cx retdelay endp code ends end start2 code segment assume cs:codestart: mov dx,283h mov al,01010010b out dx
15、,al mov dx,281h mov al,03h out dx,al mov ah,4ch int 21hcode ends end start微机实验111data segmentx db are you ready ?,0ah,0dh,$y db IRQ10 INTERRUPT NOW !,0ah,0dh,$data endscode segment assume cs:code,ds:datastart:mov ax,cs mov ds,ax lea dx,ZD mov ax,2572h int 21h cli in al,0a1h and al,0fbh out 0a1h,al s
16、ti mov cx,20 l1: push cx mov ax,data mov ds,ax lea dx,x mov ah,09h int 21h call delay pop cx loop l1 mov ah,4ch int 21h ZD PROC NEAR push ax push bx push cx push dx mov cx,5 again:push cx push dx lea dx,y mov ah,09h int 21h call delay pop dx pop cxloop againpop dxpop cxpop bxpop axmov al,20hout 20h,
17、almov al,20hout 0a0h,aliretZD endpdelay proc near mov bx,1500h for1:mov cx,1500h for2:loop for2 dec bx jnz for1 retdelay endpcode endsend start 2data segmentx db are you ready ?,0ah,0dh,$data endscode segment assume cs:code,ds:datastart:mov ax,cs mov ds,ax lea dx,ZD mov ax,2572h int 21h cli in al,0a
18、1h and al,0fbh out 0a1h,al sti mov cx,20 l1: push cx mov ax,data mov ds,ax lea dx,x mov ah,09h int 21h call delay pop cx loop l1 mov ah,4ch int 21h ZD PROC NEAR push ax push bx push cx push dx mov cx,3 again:push cx mov dx,280h mov al,0ffh out dx,al call delay mov al,00h out dx,al call delaypop cxloop againpop dxpop cxpop bxpop axmov al,20hout 20h,almov al,20hout 0a0h,aliretZD endpdelay proc near mov bx,1500h for1:mov cx,1500h for2:loop for2 dec bx jnz for1 retdelay endpcode endsend start
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2