How do you do this in Assembly


Closed Thread
Results 1 to 4 of 4
  1. #1
    ice's Avatar
    ice Guest

    Default How do you do this in Assembly

    Hello..
    i'm trying to port the "quadrature decoding" program to assembly.
    The original thread is over here.

    I'm running into a few problems

    1>
    coverting "new=PORTB & %11000000" to assembly

    Code:
    movf	PORTB,W
                             ANDLW	11000000   ;take in portB ,and with 11000000 and store in "W"
    		movwf	_new	   ;load into "new" variable
    The statement ANDLW 11000000 in assembly is written as ANDLW b'11000000'
    However it doesnt compile if i put in ANDLW b'11000000'

    2>how do i compare 2 variables "old_val = new_val" in assembly?

    Thank you

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Ice,

    Ice>>Hello..i'm trying to port the "quadrature decoding" program to assembly.
    The original thread is over here.
    I'm running into a few problems<<


    99 percent of the folks on this forum use Pic Basic or Pic Basic Pro. Maybe Melanie, Ralph, or Mister-e may get a wild hair and tackle the problem for you, if they have time. People use PBP, so they do not have to mess with the assembly routines. One way how you can find your answer, is look at the detailed Data sheet of your PIC chip you are using. I will show you how to use assembly to assign your Ports... etc. Some data sheets will give you all 32 assembly commands. Called RISC Reduced Instruction S (forgot what the S was Set?) Code.

    Its been 15 years since I have messed with assembly...Most of it I have forgot <g>. If you have PBP, you can write the routine, and look at your (PBP MACRO-type) assembly code after a compilation. Or, you can go to compilespot, and do it for free.... Just write the very basic of what you need.

    Val1 var byte
    Val2 Var byte

    ...
    ...
    Val1=Portb
    if(Val1> Valb) goto .....
    end

    Compile and look at the assembly.

    Realize that it is not TRUE assembly But gives a person a idea via the small subroutines or macros that PBP uses to work with Assembly.



    Here is a thread that may help:
    http://www.picbasic.co.uk/forum/show...light=assembly

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Ice,

    See new post in thread "decoding quadrature encoders".

    Luciano

  4. #4
    ice's Avatar
    ice Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Dwayne,
    I needed the assembly as im using it for an interrrupt program for decoding encoders...
    It's a part of this thread
    http://www.picbasic.co.uk/forum/showthread.php?t=1552

    Thanks Luciano..im working on the code tday

Similar Threads

  1. Microchip Assembly Commands
    By picnaut in forum Documentation
    Replies: 6
    Last Post: - 18th March 2011, 01:06
  2. Picbasic Pro Demo assembly errors
    By mikeRho in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd January 2008, 07:41
  3. Assembly Guru : Question
    By Archangel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th May 2007, 04:51
  4. from assembly to basic
    By shantanu in forum Off Topic
    Replies: 4
    Last Post: - 1st February 2007, 15:50
  5. Assembly Language + PBP
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th January 2006, 14:54

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