Open source PBP bootloader


Results 1 to 40 of 41

Threaded View

  1. #11
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Open source PBP bootloader

    I have run into a snag in my brain. Here is the ASM:
    Code:
    rrf    ABTIME,W                            ; B0
        btfss    STATUS,C        ; Rounding                ; B0
        addlw    0xFF
    Now I understand what it is doing, but I don't get why. The first line shifts ABTIME right 1 bit. This also clears bit 7. Because RRF rotates through the carry bit, ABTIME.0 gets put into the carry flag. So what is happening is this:
    Shift right 1 bit
    If the original (before shift) ABTIME.0=0 then add $FF to ABTIME. this seems to just clear the new ABTIME.0

    So why not just do this:
    Code:
    tempflag = ABTIME.0
    ABTIME = ABTIME >>1
    IF TEMPFLAG THEN ABTIME.0 = 0
    I guess my problem is did I evaluate what they are doing correctly?
    Last edited by ScaleRobotics; - 3rd March 2011 at 01:18.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 1

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