keil汇编编程 子程序调用问题
时间:10-02
整理:3721RD
点击:
为什么在keil中不能成功调用子程序,每次都是顺序执行,没有进入过子程序,快崩溃了,求赐教啊,程序如下:
org 0000h
sjmp start
org 0030h
start:
mov r0,#20h
mov r1,#30h
loop:mov a,@r0
lcall bian
cjne r0,#22h,next
next:jc loop
sjmp $
bian:push acc
anl a,#0f0h
cjne a,#0ah,next1
next1:jc next2
add a,07h
next2:add a,30h
mov @r1,a
pop acc
swap a
anl a,#0fh
cjne a,#0ah,next3
next3:jc next4
next4:add a,07h
add a,30h
inc r1
mov @r1,a
ret
end
org 0000h
sjmp start
org 0030h
start:
mov r0,#20h
mov r1,#30h
loop:mov a,@r0
lcall bian
cjne r0,#22h,next
next:jc loop
sjmp $
bian:push acc
anl a,#0f0h
cjne a,#0ah,next1
next1:jc next2
add a,07h
next2:add a,30h
mov @r1,a
pop acc
swap a
anl a,#0fh
cjne a,#0ah,next3
next3:jc next4
next4:add a,07h
add a,30h
inc r1
mov @r1,a
ret
end
在线求回复呀