Just looking for an explanation


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: Just looking for an explanation

    Comparing the generated Assembler code might give more clues.

    Robert

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Just looking for an explanation

    Yes the generated assembler would be smaller.
    An example of two BASIC IF...THEN comparisons in assembler
    Code:
    @ movf		_Variable	,W	'IF Variable = $A0 THEN...
    @ sublw		0xA0			'subtract comparison
    @ btfss		status		,Z	'test if result is zero
    // condition is here
    
    @ movf		_Variable	,W	'IF Variable = $00 THEN...
    @ btfss		status		,Z	'test if result is zero
    // condition is here
    You are always testing for zero, helps if the comparison is zero!

Similar Threads

  1. Help/Explanation needed
    By SahdowSA in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th February 2010, 08:23
  2. Need explanation
    By tishri in forum General
    Replies: 4
    Last Post: - 21st February 2008, 09:54
  3. explanation of step array
    By Rabm in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th September 2006, 18:00
  4. explanation about serout2 and serin2
    By micro in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th January 2006, 16:50
  5. ADCON Explanation
    By eoasap in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th December 2005, 19:08

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