A/D转换实验----------------------CODE SEGMENT ASSUME CS:CODE,DS:CODE,ES:CODE ORG 3390HH5: JMP STARTZXK EQU 0FFDCHZWK EQU 0FFDDHLED DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H DB 88H,83H,0C6H,0A1H,86H,8EH,0FFH,0CH,0DEH,0F3HBUF DB ?,?,?,?,?,?ADPORT EQU 0FFE0HSTART: MOV BUF,00H ;DISPLAY0809 00 MOV BUF+1,08H MOV BUF+2,00H MOV BUF+3,09H ;DISPLAY0809 00 MOV BUF+4,00H MOV BUF+5,00HP5: MOV AL,00H ;IN0 MOV DX,ADPORT OUT DX,AL CALL DIS MOV DX,ADPORT IN AL,DX mov dx,0ffe4h ;new add--> 138 Y1 not al ;new add out dx,al ;new add--> 驱动发光二极管 not al ;new add CALL ADS JMP P5ADS: MOV AH,AL AND AL,0FH MOV BUF+5,AL AND AH,0F0H MOV CL,4 SHR AH,CL MOV BUF+4,AH RET;--------------------------------DIS: MOV CL,20H MOV BX,OFFSET BUFDIS1: MOV AL,[BX] PUSH BX MOV BX,OFFSET LED XLAT POP BX MOV DX,ZXK OUT DX,AL MOV AL,CL MOV DX,ZWK OUT DX,AL PUSH CX MOV CX,0100HDELAY: LOOP $ POP CX CMP CL,01H JZ EXIT INC BX SHR CL,1 JMP DIS1EXIT: MOV AL,00H MOV DX,ZWK OUT DX,AL RET;--------------------------CODE ENDS END H5
一周热门 更多>