Assembly Command Clarification

While reading through the assembly command list I noticed the REP command and got curious about its limitations.
Specifically, can one REP command contain another like in this example code for driving a neopixel:
rep     #12,          %[pixel_cnt]
rdlong  %[thisPixel], %[hubPtr]
add     %[hubPtr],    #4              
mov     %[bit],       #8            

rep     #8,           #24             
drvh    %[pixel_pin]                  
testb   %[thisPixel], %[bit]       WC
incmod  %[bit],       #32         
waitx   %[tickH]                     
drvc    %[pixel_pin]                
waitx   %[tickC]                     
drvl    %[pixel_pin]                 
waitx   %[tickL]                      


  • Reps are linked to a circuit that does the rep. Only one at a time.

    The second one should just cancel the first one.

    There is no internal stack, or storage for multiple reps.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified:<br>
  • I see. So the best option in this example would be to replace the first REP with a For loop right?
  • yes, the outer loop with djnz.

    I am overwhelmed with P2 PASM. I still find goodies in P1 PASM, squeezing another 1-4 longs out of something.


    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
Sign In or Register to comment.