第2个回答 2019-10-18
;冒泡排序
ORG 0000H
SJMP MAIN
ORG 0030H
MAIN: MOV 30H,#65H
MOV 31H,#61H
MOV 32H,#66H
MOV R0,#30H
MOV R3,#2
MOV R4,#2
LOOP: MOV A,@R0
INC R0
MOV B,@R0
CJNE A,B,K1
K1:
JC L1
DJNZ R3,LOOP
DJNZ R4,L2
SJMP L3
L1:
XCH A,@R0
DEC R0
MOV @R0,A
INC R0
DJNZ R3,LOOP
DJNZ R4,L2
SJMP L3
L2:
MOV R0,#30H
MOV R3,#1
LJMP LOOP
L3: NOP
END
;悬剑
;yinweiyounidecunzai