Loops in assembly


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default Loops in assembly

    Hi, i was wondering if its possible to create a loop in assembly. I already know how to use GOTO to create a runtime loop but im looking to create a loop that is executed while the code is compiling and results in multiple lines of assembly being output.

    Example:
    Code:
    for x=0 to 5
        MOVFF var+x, var2+x
    next
    And the actual assembly code i would expect is:
    Code:
    MOVFF var+0, var2+0
    MOVFF var+1, var2+1
    MOVFF var+2, var2+2
    MOVFF var+3, var2+3
    MOVFF var+4, var2+4
    MOVFF var+5, var2+5

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Have you seen this thread? Might have the answer to your question.

    http://www.picbasic.co.uk/forum/show...t=delay+cycles

  3. #3
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    I read through that thread and found while/endw. That does the job perfectly. Thanks

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts