Shop OBEX P1 Docs P2 Docs Learn Events
PASM Question for register Indirect — Parallax Forums

PASM Question for register Indirect

SuracSurac Posts: 176
edited 2021-04-02 15:44 in Propeller 2

given the following code that should print out the COG ram on serial port in PASM

serOutCog jmprel #+1
        .counter long 1

        mov .counter, #0

.loop
        call #serCRNL     
        mov _serOutAddr_Arg0,.counter         'this will print the Address
        call #serOutAddr
        call #serSeperator
        mov _serOutLong_Arg0,.counter        'Wrong. How to copy the value IN the COG register number .counter??
        call #serOutLong

        add .counter,#1
        cmp .counter,#$1FF wc
 IF_C   jmp #.loop 

 ret

how to mov the value inside Memory location .counter to _serOutLong_Arg0 ?
_serOutLong_Arg0 is defined as long 1 in the COG

Comments

  • Use the ALTx instructions. The documentation has the details.

    alts .counter
    mov _serOutLong_Arg0,0-0
    
  • This works only with cog ram, right?
    Tor LUT and HUB there are other ways, right?
    Addresses will warp if i go over $1FF, right?

  • @Surac said:
    This works only with cog ram, right?

    Yes, ALTx is for cog RAM only.

    Tor LUT and HUB there are other ways, right?

    For LUT you use RDLUT/WRLUT, for hub you use all the other RD/WR instructions (and WMLONG)

    Addresses will warp if i go over $1FF, right?

    yes

  • Thank you very much

  • AribaAriba Posts: 2,690

    @Wuerfel_21 said:

    @Surac said:

    Addresses will warp if i go over $1FF, right?

    yes

    Does this mean that the P2 has a built in Warp drive and you can activate it if you access the cogram behind $1FF ?

  • @Ariba said:

    @Wuerfel_21 said:

    @Surac said:

    Addresses will warp if i go over $1FF, right?

    yes

    Does this mean that the P2 has a built in Warp drive and you can activate it if you access the cogram behind $1FF ?

    yes

  • @Wuerfel_21 said:

    @Ariba said:

    @Wuerfel_21 said:

    @Surac said:

    Addresses will warp if i go over $1FF, right?

    yes

    Does this mean that the P2 has a built in Warp drive and you can activate it if you access the cogram behind $1FF ?

    yes

    But only after this instruction:
    ENGAGE

Sign In or Register to comment.