minh viet chuong trinh chay sag 8 led nhung lai thay bao loi!ma minh ko bit chuyen sag ma HEX ai do biet giup minh voi.minh moi hoc ma
ORG 0000H
PORT2:
MOV P2,#00000000B
LCALL DELAY
MOV P2,#00000001B
LCALL DELAY
MOV P2,#00000011B
LCALL DELAY
MOV P2,#00000111B
LCALL DELAY
MOV P2,#00001111B
LCALL DELAY
MOV P2,#00011111B
LCALL DELAY
MOV P2,#00111111B
LCALL DELAY
MOV P2,#01111111B
LCALL DELAY
MOV P2,#11111111B
LCALL DELAY
SJMP PORT2
DELAY: MOV R6, #OFFH
HERE2: MOV R7, #0FFH
HERE1: DJNZ R7, HERE1
DJNZ R6, HERE2
RET
END
ORG 0000H
PORT2:
MOV P2,#00000000B
LCALL DELAY
MOV P2,#00000001B
LCALL DELAY
MOV P2,#00000011B
LCALL DELAY
MOV P2,#00000111B
LCALL DELAY
MOV P2,#00001111B
LCALL DELAY
MOV P2,#00011111B
LCALL DELAY
MOV P2,#00111111B
LCALL DELAY
MOV P2,#01111111B
LCALL DELAY
MOV P2,#11111111B
LCALL DELAY
SJMP PORT2
DELAY: MOV R6, #OFFH
HERE2: MOV R7, #0FFH
HERE1: DJNZ R7, HERE1
DJNZ R6, HERE2
RET
END
Comment