单片机实验,给的代码看不懂,能帮我注释一下吗,感谢了

org 0000h
ljmp start
org 0100h
start:
mov 20h,#0xbe
mov dptr,#key_vaule
mov a,#0
loop:
push acc
movc a,@a+dptr
cjne a,20h,agan
pop acc

  mov dptr,#func
rl a
  jmp @a+dptr

agan:
pop acc
inc acc
cjne a,#6,loop
sjmp $
func:
ajmp PR0
ajmp PR1
ajmp PR2
ajmp PR3
ajmp PR4
ajmp PR5

SJMP $

PR0:
mov 30h,#44h
mov 3fh,#0f1h
mov r0,#30h
mov r1,#50h
loop0:

mov a,@r0
jnb acc.7,not_z
inc r5 //??
mov @r1,a
inc r1
continue:

inc r0
cjne r0,#40h,loop0
not_z:
cjne a,#00,not_roze
inc r6
jmp continue
not_roze: //??
inc r4
mov 60h,r0
push acc
mov a,#50h
add a,r4
dec a
mov r0,a
pop acc
mov @r0,a
mov r0,60h
sjmp loop0

ret

PR1:
mov 40h,#0f3h
mov 41h,#34h
mov 42h,#45h
mov 43h,#56h

mov r1,#44h
mov r0,#40h    
mov a,@r0
cpl a
addc a,1
mov @r1,a
inc r1
inc r0

loop1:
mov a,@r0
cpl a
addc a,#0
mov @r1,a
inc r0

inc r1
cjne r0,#44h,loop1
ret
PR2:
mov a,#0xff
mov r0,#0
mov P2,#0
mov b,#16
mov r2,#16 //i
mov r1,#buf1
movx @r1,a
clr c
loop2:
clr c
movx a,@r1
add a,r0
mov r0,a
inc r1
dec r2
cjne r2,#0,loop2

div ab
mov r0,#buf2
movx @r0,a
mov r0,#buf
mov a,b
movx @r0,a
ret

PR3:
NOP

ret
PR4:
NOP

ret
PR5:
NOP

ret
ORG 0E00H
buf1 equ 200
buf2 equ 123
buf equ 220
key_vaule: db 0xee,0xde,0xbe,0x7e,0xed,0xdd

end

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问