*
*
*               MOVE BYTES TO PORT A WITH AIX and STA
*
*

*LABEL          OPER.   OPERAND         COMMENT
*****           *****   *******         *******************************

RAMStart        EQU     $0040           ; Starting location of RAM
ROMStart        EQU     $8100           ; Starting location of ROM (FLASH)
ResetVector     EQU     $FFFE           ; Reset vextor address
PORTA           EQU     $00             ; Address of Port A
DDRA            EQU     $04             ; Address of data direction
                                        ; register for Port A

                ORG     Resetvector
                FDB     MAIN

                ORG     RAMStart

BEGIN           FCB     'Hello World'
END             FCB     $00


                ORG     ROMStart


MAIN            LDA     #$FF            ; Load A with FF
                STA     DDRA            ; Set Port A for output

                LDHX    #BEGIN          ; Point to string in memory
LOOP            LDA     ,X              ; Move data from memory to A
                STA     PORTA           ; Move A to Port A
                AIX     #$01            ; Add immidiate value to H:X (ıncrease H:X by 1)
                CMP     END             ; has pointer reached END value
                BNE     LOOP            ; Branch if not equal

                NOP                     ; No operation
                NOP




