试编写MCS-51单片机程序,计算∑i,I=1~100
扫描二维码
随时随地手机看文章
试编写MCS-51单片机程序,计算∑i,I=1~100。
参考单片机汇编语言程序:
org000h
ljmpmain
org030h
main:mov 45h,#011h
mov 46h,#022h
mov 47h,#033h
mov 48h,#044h
mov 49h,#00h
mov r0,#45h
mov r7,#5
mov r6,#4
acallyiwei
sjmp $
yiwei:clr c
loop2:mov a,@r0
rrc a
mov @r0,a
inc r0
djnzr7,loop2
movr0,#45h
movr7,#5
djnzr6,yiwei
ret