*
*
*               SHIFT INSTRUCTIONS
*
*
RAMStart        EQU     $0040
RomStart        EQU     $E000
ResetVector     EQU     $FFFE

                ORG     ResetVector
                FDB     MAIN

                ORG     RAMStart
MEM1            FCB     $01
MEM2            FCB     $10

                ORG     RomStart

MAIN            LDA     #%00000001    ; Load A to $01
                LDX     #%00000001    ; Load X to $01

*
*               ARTITMETIC SHIFT LEFT INSTRUCTIONS
*               PUT ZERO ON THE RIGHT
*               PUT THE MOST SIGNIFICANT BIT INTO CARRY BIT
*

                ASLA                  ; Arithmetic shift left A
                ASLX                  ; Arithmetic shift left X
                ASL     MEM2          ; Arithmetic shift left content of memory
                ASL     MEM2          ; Arithmetic shift left content of memory
                ASL     MEM2          ; Arithmetic shift left content of memory
                ASL     MEM2          ; Arithmetic shift left content of memory
                ASL     MEM2          ; Arithmetic shift left content of memory
                NOP

*
*               LOGIC SHIFT LEFT INSTRUCTIONS ARE SYNONYMS OF ASLx, SO SAME AS ASLx
*               PUT ZERO ON THE RIGHT
*               PUT THE MOST SIGNIFICANT BIT INTO CARRY BIT
*

                LSLA                  ; Logic shift left A
                LSLX                  ; Logic shift left X
                LSL     MEM1          ; Logic shift left conent of memory
                NOP


*
*               ARTITMETIC SHIFT RIGHT INSTRUCTIONS
*               HOLDS THE MOST SIGNIFICANT BIT IN ITS POSITION
*               PUT THE LEAST SIGNIFICANT BIT INTO CARRY BIT

                LDA     #%10000001         ; Load A to $01
                LDX     #%10000001         ; Load X to $01
                MOV     #%10010000,MEM2    ; Load X to $01
                ASRA                       ; Arithmetic shift right A
                ASRX                       ; Arithmetic shift right X
                ASR     MEM2               ; Arithmetic shift right content of memory
                ASR     MEM2               ; Arithmetic shift right content of memory
                ASR     MEM2               ; Arithmetic shift right content of memory
                ASR     MEM2               ; Arithmetic shift right content of memory
                ASR     MEM2               ; Arithmetic shift right content of memory
                NOP

*
*               LOGIC SHIFT RIGHT INSTRUCTIONS
*               PUT ZERO INTO THE MOST SIGNIFICANT BIT
*               PUT THE LEAST SIGNIFICANT BIT INTO CARRY BIT

                LDA     #%10000001         ; Load A to $01
                LDX     #%10000001         ; Load X to $01
                MOV     #%10010000,MEM2    ; Load X to $01
                LSRA                       ; Logic shift right A
                LSRX                       ; Logic shift right X
                LSR     MEM2               ; Logic shift right content of memory
                LSR     MEM2               ; Logic shift right content of memory
                LSR     MEM2               ; Logic shift right content of memory
                LSR     MEM2               ; Logic shift right content of memory
                LSR     MEM2               ; Logic shift right content of memory
                NOP

*
*               ROTATE LEFT INSTRUCTIONS
*               PUT THE MOST SIGNIFICANT BIT INTO CARRY BIT
*               BIT 0 IS LOADED FROM CARRY BIT
*

                LDA     #%10000001         ; Load A to $01
                LDX     #%10000001         ; Load X to $01
                MOV     #%10010000,MEM2    ; Load X to $01
                ROLA                       ; Rotate left A
                ROLX                       ; Rotate left X
                ROL     MEM2               ; Rotate left content of memory
                ROL     MEM2               ; Rotate leftt content of memory
                ROL     MEM2               ; Rotate left content of memory
                ROL     MEM2               ; Rotate left content of memory
                ROL     MEM2               ; Rotate left content of memory
                NOP

*
*               ROTATE RIGHT INSTRUCTIONS
*               PUT THE LEAST SIGNIFICANT BIT INTO CARRY BIT
*               BIT 7 IS LOADED FROM CARRY BIT
*

                LDA     #%10000001         ; Load A to $01
                LDX     #%10000001         ; Load X to $01
                MOV     #%10010000,MEM2    ; Load X to $01
                RORA                       ; Rotate right A
                RORX                       ; Rotate right X
                ROR     MEM2               ; Rotate right content of memory
                ROR     MEM2               ; Rotate right content of memory
                ROR     MEM2               ; Rotate right content of memory
                ROR     MEM2               ; Rotate right content of memory
                ROR     MEM2               ; Rotate right content of memory
                NOP
                
*
*
*               REMAINING LOGIC INSTRUCTIONS
*
*

                SEC             ; Set Carry Bit
                CLC             ; Clear Carry Bit
                
                SEI             ; Set Interrupt Bit
                CLI             ; Clear Interrupt Bit
                NOP
                
                
               


