📄 led.asm
字号:
$MOD51
E BIT P3.2
RS BIT P3.1
RW BIT P3.0
org 0
mov p2,#0
main: lcall led
led:
mov p2,#0
lcall delay
xuat:
mov p2,#00000001b
lcall delay
mov p2,#00000010b
lcall delay
mov p2,#00000100b
lcall delay
mov p2,#00001000b
lcall delay
mov p2,#00010000b
lcall delay
mov p2,#00100000b
lcall delay
mov p2,#01000000b
lcall delay
mov p2,#10000000b
lcall delay
mov p2,#0
lcall delay
mov p2,#10000000b
lcall delay
mov p2,#01000000b
lcall delay
mov p2,#00100000b
lcall delay
mov p2,#00010000b
lcall delay
mov p2,#00001000b
lcall delay
mov p2,#00000100b
lcall delay
mov p2,#00000010b
lcall delay
mov p2,#00000001b
lcall delay
mov p2,#0
lcall delay
mov p2,#00000001b
lcall delay
mov p2,#00000011b
lcall delay
mov p2,#00000111b
lcall delay
mov p2,#00001111b
lcall delay
mov p2,#00011111b
lcall delay
mov p2,#00111111b
lcall delay
mov p2,#01111111b
lcall delay
mov p2,#11111111b
lcall delay
mov p2,#0
lcall delay
lcall delay
mov p2,#11111111b
lcall delay
mov p2,#0
lcall delay
lcall delay
mov p2,#11111111b
lcall delay
mov p2,#0
lcall delay
lcall delay
mov p2,#11111111b
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
mov p2,#0
delay:
mov r7,#3
vong1:
mov r6,#200
vong2:
mov r5,#150
djnz r5,$
djnz r6,vong2
djnz r7,vong1
ret
ret
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -