㈠ 50H鍒64H涓鍏辨湁鍑犱釜鍗曞厓鍦板潃
,50H鍒5FH涓鍏辨槸16涓
60H鍒64H涓鍏辨槸5涓,鍔犺搗鏉ュ氨鏄21涓
涔︿笂鍐欓敊浜
㈡ 鎬ワ紒錛侊紒奼傚悇浣嶏紒錛侊紒鍗曠墖鏈哄唴RAM鐨50H~5FH鍗曞厓淇濆瓨鏈夊嶮鍏涓鍗佸叚榪涘埗鏁
ORG 0
I DATA 4EH
J DATA 4DH
MIN DATA 4CH
TEMP DATA 4BH
ARRVY EQU #TAB
BASIC EQU 50H
POINT DATA 4AH
TAB_POINT DATA 40H
JMP MAIN
ORG 30H
MAIN:
MOV POINT,#BASIC
MOV TAB_POINT,0
MOV R0,#10H
M:
MOV A,ARRVY
MOVC A,@A+PC
MOV POINT,A
INC POINT
INC TAB_POINT
DJNZ R0,M
MOV I,0
MOV J,0
LOOP1:
CJNE I,#0FH,NEXT1
JMP RE
NEXT1:
MOV A,ARRVY
ADD A,I
MOV R0,@A
MOV R2,A
MOV MIN,I
MOV J,I
INC J
LOOP2:
CJNE J,#10H,NEXT2
JMP LOOP1
NEXT2:
MOV A,ARRVY
ADD A,J
MOV R1,@A
MOV R3,A
INC J
CJNE R0,R1,NEXT3
JMP LOOP2
NEXT3:
JNC NEXT4
JMP LOOP2
NEXT4:
MOV R4,@R3
MOV TEMP,R0
MOV @R0,R4
MOV @R3,TEMP
JMP LOOP2
RE:JMP $
ORG 5FH
TAB:DB 02H,08H,03H,0AH,00H,0BH,05H,0EH,0DH,01H,0FH,04H,06H,0CH,07H,09H
END
涔熶笉鐭ラ亾瀵逛笉瀵癸紝鎴戜笉緇忓父鐢ㄦ眹緙