Shop OBEX P1 Docs P2 Docs Learn Events
Question about the stack — Parallax Forums

Question about the stack

pedwardpedward Posts: 1,642
edited 2013-04-19 00:55 in Propeller 2
In the docs Chip wrote, he included these lines:
000011 ZC1 1 CCCC DDDDDDDDD 000011000        POPAR   D       'read [SPA++] into D, MSB into C   1
000011 ZC1 1 CCCC DDDDDDDDD 000011001        POPBR   D       'read [SPB++] into D, MSB into C   1

Now, is the bracket notation purely for convenience in expressing a concept, or does the compiler accept expressions such as:

mov foo, [SPA]
mov foo, SPA++
mov foo, SPA[15]

Meaning, can the stack be accessed like the PTR and IND pointers?

If so, what are the limits, +/-31 like PTR?

If I'm being let down, what is a more efficient table reference than:

setspa foo
popa foo

Comments

  • SapiehaSapieha Posts: 2,964
    edited 2013-04-19 00:55
    Hi pedward.

    It is what I have on it.
    000011 ZC1 1 CCCC DDDDDDDDD 000011000        POPAR   D        read [SPA++] into D, MSB into C   1
                                                                 ''Store CLUT[SPA] in register “D (0-511)” and then increment SPA.
    000011 ZC1 1 CCCC DDDDDDDDD 000011001        POPBR   D        read [SPB++] into D, MSB into C   1
                                                                 ''Store CLUT[SPB] in register “D (0-511)” and then increment SPA.
    
    000011 ZC1 1 CCCC DDDDDDDDD 000011010        POPA    D        read [--SPA] into D, MSB into C   1
                                                                 ''Decrement SPA and then store CLUT[SPA] in register “D (0-511)”.
    000011 ZC1 1 CCCC DDDDDDDDD 000011011        POPB    D        read [--SPB] into D, MSB into C   1
                                                                 ''Decrement SPB and then store CLUT[SPB] in register “D (0-511)”.
                                                                  POPA/B #0       ''#constant Not allowed
                                                                  POPA/B register ''push contents of register
                                                                  POPA/B INDA++   ''push register[INDA++] 
    
    
    pedward wrote: »
    In the docs Chip wrote, he included these lines:
    000011 ZC1 1 CCCC DDDDDDDDD 000011000        POPAR   D       'read [SPA++] into D, MSB into C   1
    000011 ZC1 1 CCCC DDDDDDDDD 000011001        POPBR   D       'read [SPB++] into D, MSB into C   1
    

    Now, is the bracket notation purely for convenience in expressing a concept, or does the compiler accept expressions such as:

    mov foo, [SPA]
    mov foo, SPA++
    mov foo, SPA[15]

    Meaning, can the stack be accessed like the PTR and IND pointers?

    If so, what are the limits, +/-31 like PTR?

    If I'm being let down, what is a more efficient table reference than:

    setspa foo
    popa foo
Sign In or Register to comment.