HSERIN seems to fail and I can't see WHY


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Any different?

    Thanks for the answer and your idea works, it it any different if I use that way or:

    for n=o to 255
    HSERIN [RxData(n)]
    next n

    except it compiles in different size?

    by the way,

    I was trying to load a Byte from the RxData array into the lowbyte and high byte of a word array "C_Data(x)". What would be the best way of doing (since this is not allowed)?

    C_Data(x).Lowbyte=RxData(n)
    C_Data(x).HighByte=RxData(n+1)

    I solved this loading with using a Melanie suggested method "C_Data.lowbyte(i) =RxData(n)" but this requires that you adresses the C_Data.Lowbyte(i) not using the word count but the position of the byte in the word array so the Highbyte iadresses as C_data.Lowbyte(i+1).

    I couldn't even get a temporary word variable to work but that could have been because of the time of the day.

    This should work right??

    Temp.Lowbyte=RxData(n)
    Temp.HighByte=RxData(n+1)
    C_Data(i)=Temp




    Not that user friendly ;-) (at least not 3 am)

    /j

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Jumper
    Thanks for the answer and your idea works, it it any different if I use that way or:

    for n=o to 255
    HSERIN [RxData(n)]
    next n
    That'll work just as well. Wouldn't be the case with SERIN2, but with HSERIN it's fine.

    I was trying to load a Byte from the RxData array into the lowbyte and high byte of a word array "C_Data(x)". What would be the best way of doing (since this is not allowed)?
    Here's another possibility...
    Code:
    C_Data(i)=RxData(n) << 8 + RxData(n+1)
    or...
    Code:
    RxData   VAR BYTE[256]
    RxDataW  VAR WORD EXT
    @RxDataW = RxData
    
    ; -- then later on ---
    
    C_Data(i) = RxDataW(n/2)
    But the second one assumes the data in the byte array is aligned to word boundaries, which may not be the case.
    <br>
    DT

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