Word In Asm


Closed Thread
Results 1 to 2 of 2

Thread: Word In Asm

  1. #1
    HBFR's Avatar
    HBFR Guest

    Default Word In Asm

    TRISB=%00000000 '0 all out
    led0 var portB.0
    comptval VAR BYTE
    val1 VAR BYTE


    init:
    low led0
    comptval=0
    val1=255
    start:
    comptval=comptval+1
    asm

    readval
    movwf _val1
    test
    bcf status,2
    movf _comptval,0
    xorwf _val1,0
    btfss status,2
    goto _start
    bsf _led0

    endasm
    pause 500
    goto start

    I try to do the same with word comptval var word and val1 var word in ASM

    No idea to do in asm to work with more than 8 bits

    Can you help me

    BB

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Words are asigned two consecutive addresses

    Hi,

    MYWORD var WORD

    lowerbyte in asm = _MYWORD
    higherbyte in asm = _MYWORD + 1

    Hope this helps.

    Regards

    Sougata

Similar Threads

  1. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

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