               ORG 0000H
               MOV 20H,#0c0H 
               MOV 21H,#0f9H
               MOV 22H,#0A4H
               MOV 23H,#0b0H  ;段码表
               MOV 24H,#01H  
               MOV 25H,#02H
               MOV 26H,#04H
               MOV 27H,#08H	 ;位选
SCAN:          MOV R0,#20H
               MOV R2,#4
               MOV R1,#24H
LOOP:          MOV P2,@R1 ;位选
               MOV P0,@R0; 段选
               INC R0
               INC R1
               LCALL DELAY
               DJNZ R2,LOOP
               MOV R2,#4
               JMP SCAN
DELAY:         MOV R3,#10  ;扫描延时
D1:            MOV R4,#20
D2:            MOV R5,#20
               DJNZ R5,$
               DJNZ R4,D2
               DJNZ R3,D1
               RET
               END
