* * * STRING COPY * * RAMStart EQU $0040 ROMStart EQU $E000 ResetVector EQU $FFFE PORTA EQU $00 ; Address of Port A DDRA EQU $04 ; Address of Data Direction ; Register A ORG ResetVector FDB MAIN ORG RAMStart BEGIN FCB 'Hello World' END FCB $00 ORG ROMStart MAIN LDHX #BEGIN ; Point begining of string in memory LOOP LDA ,X ; Move location pointed by H:X to A ; Then increment H:X STA $20,X ; Copy character ; INCX ; Increment X AIX #$01 ; Increment H:X CPHX #END ; has pointer reached END (value 00) ; BLS LOOP ; Branch lower of same NOP