+ Reply to Thread
Results 1 to 4 of 4

Thread: wz/if_z not doing what I expect

Hybrid View

  1. #1
    SSteve's Avatar
    Location
    Sierra Foothills, California (1 hr from Parallax HQ)
    Posts
    809

    Default wz/if_z not doing what I expect

    Given this code:
    Code:
    DAT
                  ...
    
                  mov test_reg, test_value          wz
            if_z  mov wait_time, long_wait_time
    
                  ...
    
    long_wait_time          long    $C000000
    short_wait_time         long    $A00000
    wait_time               res     4    
    wait_reg                res     4
    test_value              long    $FFFF_FFFF
    test_reg                res     4


    The line that begins with "if_z" shouldn't execute, right? When I run the code, it does. The complete program is attached. if I replace "test_value" in the excerpt above with "#1", the line that begins with "if_z" (as expected) doesn't execute.

    What I think is happening is that the mov statement above moves the value $FFFF_FFFF into test_reg. Where am I going wrong?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
    Attached Files Attached Files
    Last edited by ForumTools; 10-02-2010 at 07:40 PM. Reason: Forum Migration

  2. #2

    Default

    all of the predefined data, needs to be before the reserved space, the modified code is attached

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
    Attached Files Attached Files
    Last edited by ForumTools; 10-02-2010 at 07:40 PM. Reason: Forum Migration

  3. #3

    Bean's Avatar
    Location
    Near Harrisburg PA
    Posts
    7,623
    Blog Entries
    4

    Default

    Steve,
    I had made the same mistake, and couldn't figure it out either.
    Look through the "Tricks & Traps" document, it has alot of good info.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver ICwww.hc4led.com


    COMING SOON "SD DATA LOGGER" www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    Last edited by ForumTools; 10-02-2010 at 07:41 PM. Reason: Forum Migration

  4. #4
    SSteve's Avatar
    Location
    Sierra Foothills, California (1 hr from Parallax HQ)
    Posts
    809

    Default

    Thanks, CJ & Bean. I don't know how I managed to miss the Tricks & Traps document. I guess that was before I started reading the Propeller thread. What a life saver! I already managed to learn two of the Tricks the hard way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
    Last edited by ForumTools; 10-02-2010 at 07:41 PM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

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