*
*
*               BIT SET AND CLEAR INSTRUCTIONS
*
*
RAMStart        EQU     $0040
RomStart        EQU     $E000
ResetVector     EQU     $FFFE

                ORG     ResetVector
                FDB     MAIN

                ORG     RAMStart

                ORG     RomStart

*
*               BIT CLEAR AND SET WITH AND, OR INSTRUCTIONS
*
*               

MAIN            LDA     #$FF          ; SET A WITH $FF
                STA     $40           ; STORE AT $40

                LDA     #$F0          ; SET A WITH $00
                STA     $41           ; STORE AT $41

*
*               SET BIT 3 of MEMORY LOCATION $40
*
                LDA     $40           ; READ DATA AT $40
                AND     #%11111011    ; AND A with $FB to clear bit 3
                STA     $40           ; STORE AT $40
                
                
*
*               SET BIT 0 OF MEMORY LOCATION $41
*

                LDA     $41           ; READ DATA AT $40
                ORA     #%00000001    ; AND A with $FB to clear bit 3
                STA     $41           ; STORE AT $40

*
*               BIT CLEAR INSTRUCTION
*               BCLR  n, opr
*               Clear bit n in M
*
                BCLR    0,$40         ; CLEAR BIT 0 of MEMORY LOCATION $40

*
*               BIT SET INSTRUCTION
*               BSET  n, opr
*               Clear bit n in M
*                
                BSET    2,$41         ; SET BIT 2 of MEMORY LOCATION $40
                
                NOP
                
                



   
