51单片机程序看不懂了谁来讲讲

如果能标个注释的话就太谢谢了,还会额外加分
tick equ 10000
t100us equ 256-50
c100us equ 30h
ledbuf equ 0
led equ 40h
ljmp start
org 000bh
t0int:
push psw
mov a,c100us+1
jnz goon
dec c100us
goon:
dec c100us+1
mov a,c100us
orl a,c100us+1
jnz exit
mov c100us,#high(tick)
mov c100us+1,#low(tick)
cpl ledbuf
exit:
pop psw
reti
start:
mov tmod,#02h
mov th0,#t100us
mov tl0,#t100us
mov ie,#10000010b
setb tr0
clr ledbuf
clr led
mov c100us,#high(tick)
mov c100us+1,#low(tick)
loop:
mov c,ledbuf
mov led,c
ljmp loop
end

; ====== 宏定义 ======
tick   equ 10000
t100us equ 256-50
c100us equ 30h
ledbuf equ 0
led    equ 40h

; ==== 中断向量表 ====
org  0000h                   ; 此处应添加上电复位中断入口地址
ljmp start                   ; 上电复位后 长跳转到程序段的start标号位置
org  000bh                   ; 定时计数器t0的中断向量入口地址
ljmp t0int                   ; 因为中断向量表空间有限所以应在此添加长跳转指令而不是功能函数段

; ====== 程序段 ======
org  0030h                   ; 一般程序段应跳过中断向量表
; -= t0定时计数器中断 =-
t0int:                       ; 定时计数器t0中段代码段标号
push psw                     ; 将psw功能寄存器推入堆栈
;===========================================
mov  a,c100us+1              ; 对[c100us:c100us+1]做减一运算 
jnz  goon                    ; 对[c100us:c100us+1]做减一运算 
dec  c100us                  ; 对[c100us:c100us+1]做减一运算 
goon:                        ; 对[c100us:c100us+1]做减一运算 
dec  c100us+1                ; 对[c100us:c100us+1]做减一运算 
mov  a,c100us                ; 对[c100us:c100us+1]做是否为零判断
orl  a,c100us+1              ; 对[c100us:c100us+1]做是否为零判断
jnz  exit                    ; 对[c100us:c100us+1]做是否为零判断
mov  c100us,#high(tick)      ; 对[c100us:c100us+1]重新赋值
mov  c100us+1,#low(tick)     ; 对[c100us:c100us+1]重新赋值
cpl  ledbuf                  ; 对ledbuf取反
;===========================================
exit:                        ; 退出中断标号
pop  psw                     ; 将psw功能寄存器取出堆栈
reti                         ; 中断返回
; -= 主程序 =-
start:                       ; 主程序段起始标号
mov tmod,#02h                ; 定义t0工作方式为“自动重载8位定时器/计数器”
mov th0,#t100us              ; th0 赋初值
mov tl0,#t100us              ; tl0 赋初值
mov ie,#10000010b            ; 开总中断使能和定时计数器t0中断的使能
setb tr0                     ; 开启定时计数器t0
clr ledbuf                   ; 清ledbuf 
clr led                      ; 清led
mov c100us,#high(tick)       ; 对[c100us:c100us+1]赋初值
mov c100us+1,#low(tick)      ; 对[c100us:c100us+1]赋初值
loop:                        ; 主循环
mov c,ledbuf                 ; 将ledbuf赋值给led
mov led,c                    ; 将ledbuf赋值给led
ljmp loop                    ; 主循环
end                          ; 程序结束

温馨提示:答案为网友推荐,仅供参考
相似回答