prog45.asm
来自「主要是8051源代码」· 汇编 代码 · 共 32 行
ASM
32 行
; PROG45 - Poll a button and turn on an LED
;
; This Application Turns on an LED and Loops forever afterward.
;
; Myke Predko
; 98.02.18
;
; Hardware Notes:
; 80C520 Running at 1 MHz
; P1.0 is the LED (to light, it is pulled down)
; P1.1 is connected to a Momentary ON Switch that Pulls down the Line.
; Variable Declarations
; Mainline
org 0 ; Execution Starts Here
Loop: ; Loop Here Forever
jb P1.1,LEDON ; If Button High, Make LED High
anl P1,#0FEh ; Pull Down P1.0 To Turn on LED
ajmp Loop
LEDON: ; Button High, Turn On LED
orl P1,#001h
ajmp Loop
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?