Shop OBEX P1 Docs P2 Docs Learn Events
CALLD and LOC assembler question — Parallax Forums

CALLD and LOC assembler question

reading the assembler instruction table i stumbled across these 2 instructions

CALLD   PA/PB/PTRA/PTRB,#{\}A       EEEE 11100WW RAA AAAAAAAAA AAAAAAAAA        Call to A by writing {C, Z, 10'b0, PC[19:0]} to PA/PB/PTRA/PTRB (per W). If R = 1 then PC += A, else PC = A.
LOC PA/PB/PTRA/PTRB,#{\}A       EEEE 11101WW RAA AAAAAAAAA AAAAAAAAA        Get {12'b0, address[19:0]} into PA/PB/PTRA/PTRB (per W). If R = 1, address = PC + A, else address = A.

in the description the tern (per W) is used. does this mean:

  • WW = 00 means CALLD PA
  • WW = 01 means CALLD PB
  • WW = 10 means CALLD PTRA
  • WW = 11 means CALLD PTRB

?

Comments

  • Cluso99Cluso99 Posts: 18,069

    WW does select PA/PB/PTRA/PTRB but I am not sure where the codes 0-3 are defined.
    For confirmation, just compile a simple set of instructions with flexprop and look at the listing.

  • @Surac said:
    reading the assembler instruction table i stumbled across these 2 instructions

    CALLD PA/PB/PTRA/PTRB,#{\}A       EEEE 11100WW RAA AAAAAAAAA AAAAAAAAA        Call to A by writing {C, Z, 10'b0, PC[19:0]} to PA/PB/PTRA/PTRB (per W). If R = 1 then PC += A, else PC = A.
    LOC   PA/PB/PTRA/PTRB,#{\}A       EEEE 11101WW RAA AAAAAAAAA AAAAAAAAA        Get {12'b0, address[19:0]} into PA/PB/PTRA/PTRB (per W). If R = 1, address = PC + A, else address = A.
    

    in the description the tern (per W) is used. does this mean:

    • WW = 00 means CALLD PA
    • WW = 01 means CALLD PB
    • WW = 10 means CALLD PTRA
    • WW = 11 means CALLD PTRB

    ?

    That's correct.
    ww is offset from PA register.

Sign In or Register to comment.