P1.0-P1.3:LED灯,P1.4-P1.7按键,P0口为数码管,现要求按键的电平与数码管相对应如:0001,数码管显1ORG\x05000H\x05LJMP\x05MAIN\x05ORG\x050030HDBB:\x05DB\x050CH,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,88H,83H,0C6H,0A1H,86H,8EHXS

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 20:25:46
P1.0-P1.3:LED灯,P1.4-P1.7按键,P0口为数码管,现要求按键的电平与数码管相对应如:0001,数码管显1ORG\x05000H\x05LJMP\x05MAIN\x05ORG\x05

P1.0-P1.3:LED灯,P1.4-P1.7按键,P0口为数码管,现要求按键的电平与数码管相对应如:0001,数码管显1ORG\x05000H\x05LJMP\x05MAIN\x05ORG\x050030HDBB:\x05DB\x050CH,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,88H,83H,0C6H,0A1H,86H,8EHXS
P1.0-P1.3:LED灯,P1.4-P1.7按键,P0口为数码管,现要求按键的电平与数码管相对应如:0001,数码管显1
ORG\x05000H
\x05LJMP\x05MAIN
\x05ORG\x050030H
DBB:\x05DB\x050CH,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,88H,83H,0C6H,0A1H,86H,8EH
XS:\x05MOV\x05A,\x05P1
\x05
\x05ANL\x05A,\x05#0FH
\x05MOV\x05DPTR,\x05#0030H
\x05MOVC\x05A,\x05@A+DPTR
\x05CPL\x05A
\x05MOV\x05P0,\x05A
\x05RET
MAIN:\x05MOV\x05DPTR,\x05#DBB
LOOP:\x05LCALL\x05YS1S
\x05LCALL\x05QDJ
\x05SJMP\x05LOOP
\x05
\x05
\x05MOV\x05A,\x05P1
\x05ORL\x05A,\x05#0FH
\x05CPL\x05A
\x05JZ\x05RP
L1:\x05LCALL\x05YS1S
\x05MOV\x05A,\x05P1
\x05CJNE\x05A,\x05#0FFH,\x05L2
\x05SJMP\x05RP
L2:\x05LCALL\x05QDJ
RP:\x05RET
\x05
QDJ:\x05JB\x05P1.7,\x05K6
\x05CPL\x05P1.3
K6:\x05JB\x05P1.6,\x05K5
\x05CPL\x05P1.2
K5:\x05JB\x05P1.5,\x05K4
\x05CPL\x05P1.1
K4:\x05JB\x05P1.4,\x05RQ
\x05CPL\x05P1.0
RQ:\x05RET
YS1S:\x05MOV\x05R3,\x05#250
LOOP3:\x05NOP
\x05NOP
\x05DJNZ\x05R3,\x05LOOP3
\x05RET
YS10MS:\x05MOV\x05R4,\x05#10
LOOP5:\x05LCALL\x05YS1S
\x05DJNZ\x05R4,\x05LOOP5\x05
\x05RET
这是我自己编的,汇编初入门,
1110对应的才是1

P1.0-P1.3:LED灯,P1.4-P1.7按键,P0口为数码管,现要求按键的电平与数码管相对应如:0001,数码管显1ORG\x05000H\x05LJMP\x05MAIN\x05ORG\x050030HDBB:\x05DB\x050CH,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,88H,83H,0C6H,0A1H,86H,8EHXS
按键一端接高电平还是低电平?
看到几个地方错.