试用单片机keil c51写出一条把片内RAM 50H~59H单元清零的程序. 汇编

2024-12-26 01:49:00
推荐回答(4个)
回答1:

MOV R0,#50H
MOV R2,#10
CLR A
LOOP:
MOV @R0,A
INC R0
DJNZ R2,LOOP
RET

回答2:

mov r7,#10
mov r0,#59h
clr a
mov @r0,a
dec r0
djnz r7,$-2

回答3:

org 0
LJMP start

org 100H
start:
CLR A
MOV R0,#49H
MOV R1,#10
LOOP:
INC R0
MOV @R0,A
DJNZ R1,LOOP
END

回答4:

ORG 0000H
MOV SP,#50H
CLR A
MOV R0,A
PUSH 00H
PUSH 00H
PUSH 00H
PUSH 00H
PUSH 00H
PUSH 00H
PUSH 00H
PUSH 00H
PUSH 00H
PUSH 00H

END