*
*
*               ARRAY B (i) = ARRAY A (i) * 2 + 1
*               SOLUTION I
*

*LABEL          OPER.   OPERAND         COMMENT
*****           *****   *******         *******************************

RAMStart        EQU     $0040           ; Starting location of RAM
ROMStart        EQU     $8000           ; Starting location of ROM (FLASH)
ResetVector     EQU     $FFFE           ; Reset vextor address


                ORG     Resetvector
                FDB     MAIN


                ORG     RAMStart
A_Data          FCB     $31,$02,$1C,$1C,$1D,$18,$04,$03,$02,$01     ; Array A
B_Data          RMB     10                                          ; Reserve 10 memory bytes for Array B



                ORG     ROMStart
MAIN            LDX     #$0A                    ; Load X with 10

LOOP            LDA     A_Data-1,X              ; Load A with data pointed by X+A_data-1
*               ADD     A_Data-1,X
                LSLA
*               INCA
                ADD     #$01
                STA     B_data-1,X              ; Store A to location pointed by X+C_data-1

                DBNZX   LOOP                    ; Decrement and branch if X not equal to zero

DONE            BRA     DONE                    ; Branch always to DONE



