用汇编语言程序 编写一个关于51单片机的程序:一个开关控制一盏LED的亮灭

2024-12-02 09:58:02
推荐回答(2个)
回答1:

KEY EQU P1.0
LED EQU P1.4
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
    JB KEY,MAIN1
    CLR LED
    SJMP MAIN
MAIN1:
    SETB LED
    SJMP MAIN
    END

回答2:

KEY EQU P1.0

LED EQU P1.4

ORG 0000H

LJMP MAIN

ORG 0030H

MAIN:JB KEY,MAIN1

CLR LED

SJMP MAIN

MAIN1:SETB LED

SJMP MAIN

END