Modulus Question


Results 1 to 3 of 3

Threaded View

  1. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Try this; mins = (mins + 1) // 60 to force the add before the divide.

    If you're really "squished" for space, this will do the same thing, and save
    you around 10 words or so code space.

    Code:
    asm
      incf _Mins,f
      movf _Mins,w
      sublw D'60'
      btfss STATUS,2
      goto _NotOver
      clrf _Mins    
    endasm
    NotOver:
    Just be sure to keep Mins in bank0.
    Last edited by Bruce; - 2nd March 2006 at 01:28.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Crystals & Caps - Super noob question??
    By kevj in forum General
    Replies: 4
    Last Post: - 24th September 2007, 17:11
  2. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 15:44
  3. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

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