logic gate

1)      Write an assembly program to implement the logic operation shown below. Assume that the 12MHz frequency is used.


                        


                        ORG               0H
                        LCALL          FIRST
                        LCALL          SECOND
                        LCALL          THIRD
                        LCALL          LAST

FIRST:           MOV              C,P2.0
                        JNB                P2.1,SKIP
                        CPL                C
SKIP:             ORL               C,P2.2
                        MOV              P3.2,C
                        RET

SECOND:      MOV              C,P2.3
                        ORL               C,P2.4
                        ORL               C,P2.5
                        CPL                C
                        MOV              P1.2,C
                        RET

THIRD:          MOV              C,P2.6
                        ORL               C,P2.7
                        CPL                C
                        ANL               C,/P3.0
                        CPL                C
                        MOV              P1.3,C
                        RET

LAST:            MOV              C,P1.0
                        ANL               C,P1.2
                        ANL               C,P1.3
                        MOV              P1.1,C

EXIT:             SJMP              EXIT
                        END



Leave a Reply