1 Star 0 Fork 0

李想20040307/python

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
8251.asm 2.90 KB
Copy Edit Raw Blame History
李想 authored 2024-11-26 21:16 . 11.26
;1.用ADC0809实现数据采集,结果用8255C口
;送LED显示,LED全亮到全灭
;2.将转化结果送到2位数码管显示3.0
CODE SEGMENT
ASSUME CS:CODE
AAA8255 EQU 8000H
BBB8255 EQU 8002H
CCC8255 = 8004H
CON8255 = 8006H
ADC0809 = 0E002H;/Y6 1 1 1 0 IN1 2 IN6 C
START:
;8255初始化
MOV DX,CON8255
MOV AL,80H
OUT DX,AL
;adv0809启动转换
ABC: MOV DX,ADC0809
MOV AL,0
OUT DX,AL
;调用延时子程序大约100微秒
MOV CX,0FFH
LOOP $
;读取转换结果数据从ADC0809到CPU内部AL寄存器
MOV DX,ADC0809
IN AL,DX
;将AL寄存器数据送到8255C口
MOV DX, CCC8255
OUT DX, AL
JMP ABC
CODE ENDS
END START
;用adc0809实现数据采集(0-5v)结果用8255C口
;送LED显示,LED从全亮到全
;2将转换结果送2位数码管显示
CODE SEGMENT
ASSUME CS:CODE
AAA8255 EQU 8000H
BBB8255 EQU 8002H
CCC8255 EQU 8004H
CON8255 EQU 8006H
ADC0809 EQU 0E00CH;/Y6 a3 a2 a1 0
START: ;0110
; 8255初始化
MOV DX,CON8255
MOV AL,80H
OUT DX,AL
;调用adc0809 启动转换
ABC: MOV DX,ADC0809
MOV AL,0
OUT DX,AL
; 延长子程序 大概100us
MOV CX,00FFH
LOOP $
;读取转换结果
MOV DX,ADC0809
IN AL,DX
MOV DX,CCC8255
OUT DX,AL
JMP ABC
;
CODE ENDS
END START
CODE SEGMENT
ASSUME CS:CODE
AAA8255 EQU 8000H
BBB8255 EQU 8002H
CCC8255 EQU 8004H
CON8255 EQU 8006H
ADC0809 EQU 0E00CH ; ADC0809地址
START: ; 程序入口
; 8255初始化
MOV DX, CON8255
MOV AL, 80H ; 设置8255为模式 0
OUT DX, AL
ABC:
; 调用ADC0809启动转换
MOV DX, ADC0809
MOV AL, 0 ; 启动转换
OUT DX, AL
; 延时子程序,大约100us
MOV CX, 00FFH
LOOP $
; 读取转换结果
MOV DX, ADC0809
IN AL, DX ; 从ADC读取结果
; 将结果送到8255
MOV DX, CCC8255
OUT DX, AL ; 发送结果到8255
; 结果显示到数码管
MOV DX, AAA8255
OUT DX, AL
JMP ABC
CODE ENDS
END START
CODE SEGMENT
ASSUME CS:CODE
AAA8255 EQU 8000H
BBB8255 EQU 8002H
CCC8255 EQU 8004H
CON8255 EQU 8006H
ADC0809 EQU 0E00CH
START:
MOV DX, CON8255
MOV AL, 80H
OUT DX, AL
ABC:
MOV DX, ADC0809
MOV AL, 0
OUT DX, AL
MOV CX, 00FFH
LOOP $
MOV DX, ADC0809
IN AL, DX
MOV DX, CCC8255
OUT DX, AL
MOV DX, AAA8255
OUT DX, AL
JMP ABC
CODE ENDS
END START
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/li-xiang-20040307/python.git
git@gitee.com:li-xiang-20040307/python.git
li-xiang-20040307
python
python
master

Search

0d507c66 1850385 C8b1a773 1850385