1、94附录二:实验参考程序;= D/A(调零程序) =;-D/A 0V 输出(调基准电压)-;在进行 D/A 输出方波/锯齿波、小直流电机实验之前,必须先运行本调零程序!;装载并连续运行本程序,调节基准电压控制电位器 W2,;使 D/A 输出端“AOUT”输出电压为 0VCODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODE;=DAPORT EQU 0FFE0hZXK EQU 0FFDCHZWK EQU 0FFDDH;=ORG 3480HSTART: MOV BUF,00H ;DISPLAY 0832 80MOV BUF+1,08HMOV BUF+2,03HMOV
2、BUF+3,02HMOV BUF+4,08HMOV BUF+5,00HP5: MOV AL,80Hmov dx,DAPORTout dx,alcall p6jmp p5;=p6: mov cx,0100hp8: push cxCALL DISpop cxloop p8ret;=DIS: MOV CL,20HMOV BX,OFFSET BUFDIS1: MOV AL,BXPUSH BXMOV BX,OFFSET LEDXLAT95POP BXMOV DX,ZXKOUT DX,ALMOV AL,CLMOV DX,ZWKOUT DX,ALPUSH CXMOV CX,0100HDELAY: LOOP
3、$POP CXCMP CL,01HJZ EXITINC BXSHR CL,1JMP DIS1EXIT: MOV AL,00HMOV DX,ZWKOUT DX,ALRETBUF DB ?,?,?,?,?,?LED DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90HDB 88H,83H,0C6H,0A1H,86H,8EH,0FFH,0CH,0DEH,0F3H;=CODE ENDSEND START;-8255A(1) -CODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 32C0HH1: JMP STARTP1PA
4、 EQU 0FFD8HPB EQU 0FFD9HPC EQU 0FFDAHPCTL EQU 0FFDBHSTARTP1:MOV DX,PCTLMOV AL,80HOUT DX,ALMOV AL,55HP11: MOV DX,PAOUT DX,AL96INC DXOUT DX,ALINC DXOUT DX,ALMOV CX,0800HLOOP $NOT ALJMP P11CODE ENDSEND H1;-8255A(2) PA,PB-CODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 32E0HPA EQU 0FFD8HPB EQU 0FFD9HPC EQ
5、U 0FFDAHPCTL EQU 0FFDBHH2: MOV DX,PCTLMOV AL,90HOUT DX,ALP2: MOV DX,PAIN AL,DXINC DXOUT DX,ALJMP P2CODE ENDSEND H2;-8255A(3) -CODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 32F0HPA EQU 0FFD8HPB EQU 0FFD9HPC EQU 0FFDAHPCTL EQU 0FFDBHH3: MOV AL,88HMOV DX,PCTLOUT DX,AL ;MOD:0,MOV DX,PA97MOV AL,0B6HOUT D
6、X,ALINC DXMOV AL,0DHOUT DX,ALCALL DELAY1P30: MOV AL,75HMOV DX,PAOUT DX,ALINC DXMOV AL,0DHOUT DX,ALCALL DELAY1CALL DELAY1MOV CX,08HP31: MOV DX,PAMOV AL,0F3HOUT DX,ALINC DXMOV AL,0CHOUT DX,ALCALL DELAY2MOV DX,PAMOV AL,0F7HOUT DX,ALINC DXMOV AL,0DHOUT DX,ALCALL DELAY2LOOP P31MOV DX,PAMOV AL,0AEHOUT DX,
7、ALINC DXMOV AL,0BHOUT DX,ALCALL DELAY1CALL DELAY1MOV CX,08HP32: MOV DX,PA98MOV AL,9EHOUT DX,ALINC DXMOV AL,07HOUT DX,ALCALL DELAY2MOV DX,PAMOV AL,0BEHOUT DX,ALINC DXMOV AL,0FHOUT DX,ALCALL DELAY2LOOP P32JMP P30DELAY1: PUSH AXPUSH CXMOV CX,0030HDELY2: CALL DELAY2LOOP DELY2POP CXPOP AXRETDELAY2: PUSH
8、CXMOV CX,8000HLOOP $POP CXRETCODE ENDSEND H3;-I/O-CODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 3380H ;273,244PIO1 EQU 0FFE0HPIO2 EQU 0FFE4HP4: MOV DX,PIO1IN AL,DXMOV DX,PIO2OUT DX,AL99JMP P4CODE ENDSEND P4;-硬件实验五 A/D 转换实验-CODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 3390HH5: JMP STARTZXK EQU 0FFDC
9、HZWK EQU 0FFDDHLED DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90HDB 88H,83H,0C6H,0A1H,86H,8EH,0FFH,0CH,0DEH,0F3HBUF DB ?,?,?,?,?,?ADPORT EQU 0FFE0HSTART: MOV BUF,00H ;DISPLAY 0809 00MOV BUF+1,08HMOV BUF+2,00HMOV BUF+3,09H ;DISPLAY 0809 00MOV BUF+4,00HMOV BUF+5,00HP5: MOV AL,00H ;IN0MOV DX,ADPORTOUT
10、 DX,ALCALL DISMOV DX,ADPORTIN AL,DXmov dx,0ffe4h ;new add 138 Y1not al ;new addout dx,al ;new add 驱动发光二极管not al ;new addCALL ADSJMP P5ADS: MOV AH,ALAND AL,0FHMOV BUF+5,ALAND AH,0F0HMOV CL,4SHR AH,CLMOV BUF+4,AHRET100;-DIS: MOV CL,20HMOV BX,OFFSET BUFDIS1: MOV AL,BXPUSH BXMOV BX,OFFSET LEDXLATPOP BXM
11、OV DX,ZXKOUT DX,ALMOV AL,CLMOV DX,ZWKOUT DX,ALPUSH CXMOV CX,0100HDELAY: LOOP $POP CXCMP CL,01HJZ EXITINC BXSHR CL,1JMP DIS1EXIT: MOV AL,00HMOV DX,ZWKOUT DX,ALRET;-CODE ENDSEND H5;-D/A(1) -;D/A 0VAsm88da_0v.asm;D/AAOUT0VCODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 33E0H101DAPORT EQU 0FFE0HH6: MOV AL
12、,0FFHP6: MOV DX,DAPORTOUT DX,ALMOV CX,0400HLOOP $NOT ALJMP P6CODE ENDSEND H6;-D/A 转换实验(2) 锯齿波-;注意:进行本实验前,请先装载运行 D/A 0V 输出(调基准电压)程序Asm88da_0v.asm; 使 D/A 输出端“AOUT”输出电压为 0V,再进行本实验。CODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 33F0HDAPORT EQU 0FFE0HH7: MOV DX,DAPORTMOV AL,00HP7: OUT DX,ALINC ALJMP P7COD
13、E ENDSEND H7;-8259 单级中断控制器实验-CODE SEGMENTASSUME CS:CODE,DS:CODE,ES:CODEORG 3400HH8: JMP P8259ZXK EQU 0FFDCHZWK EQU 0FFDDHLED DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90HDB 88H,83H,0C6H,0A1H,86H,8EH,0FFH,0CH,0DEH,0F3HBUF DB ?,?,?,?,?,?Port0 EQU 0FFE0HPort1 EQU 0FFE1HP8259: CLICALL WP ;初始化显示“P.”MOV
14、 AX,OFFSET INT8259102MOV BX,003CHMOV BX,AXMOV BX,003EHMOV AX,0000HMOV BX,AXCALL FOR8259mov si,0000hSTICON8: CALL DISJMP CON8;-INT8259:cliMOV BX,OFFSET BUFMOV BYTE PTR BX+SI,07HINC SICMP SI,0007HJZ X59XX59: MOV AL,20HMOV DX,Port0OUT DX,ALmov cx,0050hxxx59: push cxcall dispop cxloop xxx59pop cxmov cx,
15、3438hpush cxSTIIRETX59: MOV SI,0000HCALL WPJMP XX59;=FOR8259:MOV AL,13HMOV DX,Port0OUT DX,ALMOV AL,08HMOV DX,Port1OUT DX,AL103MOV AL,09HOUT DX,ALMOV AL,7FH ;IRQ7OUT DX,ALRET;-WP: MOV BUF,11H ;初始化显示“P.”MOV BUF+1,10HMOV BUF+2,10HMOV BUF+3,10HMOV BUF+4,10HMOV BUF+5,10HRET;-DIS: MOV CL,20HMOV BX,OFFSET BUFDIS1: MOV AL,BXPUSH BXMOV BX,OFFSET LEDXLATPOP BXMOV DX,ZXKOUT DX,ALMOV AL,CLMOV DX,ZWKOUT DX,ALPUSH CXMOV CX,0100HDELAY: LOOP $POP CXCMP CL,01HJZ EXITINC BXSHR CL,1JMP DIS1EXIT: MOV AL,00HMOV DX,ZWKOUT DX,ALRET;-
Copyright © 2018-2021 Wenke99.com All rights reserved
工信部备案号:浙ICP备20026746号-2
公安局备案号:浙公网安备33038302330469号
本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。