*
*       MOVE INSTRUCTIONS
*

*LABEL   OPERATION OPERAND  COMMENTS
*******  ********* *******  ********
         ORG       $8000    ; Place instructions starting at $8000
         LDA       #$FF     ; Load AC with FF
         LDHX      #$0050   ; Load (H:X) with 0050
         LDX       #$52     ; Load X with 52

         STA       $0040    ; Store AC into location 0040
         STHX      $0041    ; Store (H:X) into locations 0041,0042
         STX       $0043    ; Store X into loaction 0043

*
*        LDA WITH DIFFERENT ADDRESING MODES
*

         CLRA               ; INHERENT

         LDA       #$55     ; Immediate

         LDA       $40      ; Direct or zero-page addressing

         LDA       $8000    ; Extended

         LDHX      #$0002   ; Load (H:X) with 0002
         LDA       $40,X    ; Indexed, 8-bit offset

         LDHX      #$0002   ; Load (H:X) with 0002
         LDA       $8000,X  ; Indexed, 16

         LDHX      #$0002   ; Load (H:X) with 0002
         LDA       ,X       ; Indexed, No offset

         LDHX      #$0002   ; Load (H:X) with 0002
         TXS                ; Transfer H:X - 1 to stack pointer
         LDA       $40,SP   ; Stack, 8-bit offset
         LDA       $8000,SP ; Stack, 16-bit offset
         
         
*
*        STACK PUSH AND PULL (POP)
*

         LDHX      #$0061   ; Reset stack pointer
         TXS                ; Transfer H:X - 1 to SP
         PSHA               ; Push A onto stack
         PSHX               ; Push X onto stack
         PSHH               ; Push H onto stack
         
         CLRA
         CLRX
         CLRH
         
         PULH               ; Pull H from stack
         PULX               ; Pull X from stack
         PULA               ; Pull A from stack
         
*
*        Register to register moves
*
         TAP                ; Transfer A to CCR
         TAX                ; Transfer X to A
         TPA                ; Transfer CCR to A
         
         TSX                ; Trasfer SP+1 to H:X
         TXA                ; Transfer X to A
         TXS                ; Transfer H:X - 1 to SP
         
*
*        MOVE INSTRUCTION
*

         MOV    #$55,$0040  ; Move #55 to location $40
         MOV    $40,$50     ; Move contents of loc. $40 to $50
         MOV    $40,X+      ; Move $40 into location pointed by H:X, then increment H:X
         LDHX   #$0040 
         MOV    X+,$60      ; Move data in location pointed by H:X to location $51
         
         



         NOP                ; No operation



