SIMPLE question


Closed Thread
Results 1 to 8 of 8

Thread: SIMPLE question

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    Duncan,

    What I was thinking...

    portA PORTB
    % 00000000 / 00001000

    <0> PORTB.0 <1>PORTB.1 .... <8>PORTA.0
    Let's say that this is my word that Contains PORTA+PORTB that I have to check.
    The followings are correct???
    ----------------------------------------------
    w0 var word
    L var byte
    H var byte

    L = PORTB
    H = PORTA
    w0.LowByte = L
    w0.HighByte = H

    If w0 > 1 then
    I WILL READ THE w0
    endif

    ---------------------------------------------------

    Thanks
    Nikos

    Retsina,Summer,Sea and Sun

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ngeronikolos View Post
    Duncan,

    What I was thinking...

    portA PORTB
    % 00000000 / 00001000

    <0> PORTB.0 <1>PORTB.1 .... <8>PORTA.0
    Let's say that this is my word that Contains PORTA+PORTB that I have to check.
    The followings are correct???
    ----------------------------------------------
    (w0 var word
    L var byte
    H var byte

    L = PORTB
    H = PORTA
    w0.LowByte = L
    w0.HighByte = H

    If w0 > 1 then
    I WILL READ THE w0
    endif

    ---------------------------------------------------

    Thanks
    Nikos

    Retsina,Summer,Sea and Sun
    If that is what you want to do, you could use Darrel's trick with EXT

    Code:
    @PORTS = PORTA
    PORTS VAR WORD EXT  ; PORTS = PORTB:PORTA
    
    ; in middle of program
    
    if PORTS > 1 then ....
    (Don' t forget to mask the unused bits of PORTA if they might not be 0)
    Last edited by paul borgmeier; - 5th February 2008 at 18:30.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. Stupid simple question.....
    By chien_fu in forum mel PIC BASIC
    Replies: 18
    Last Post: - 23rd February 2010, 13:21
  2. Simple Timer question
    By jimseng in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th September 2009, 23:12
  3. Really simple question for you experts :)
    By lew247 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th June 2008, 01:43
  4. really simple, dumb question
    By picster in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd March 2007, 22:02
  5. really simple adcin question
    By kitcat in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 21st April 2006, 09:06

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