Shop OBEX P1 Docs P2 Docs Learn Events
Recommended Additions to SX/B Online Help — Parallax Forums

Recommended Additions to SX/B Online Help

John CoutureJohn Couture Posts: 370
edited 2006-08-02 18:04 in General Discussion
In the SX/B help file (Reference / Definitions), it might help to·add to the "Variables" section.·

There is an example of a word variable IDX being split into the LSB by use of idx_LSB but there isn't any other mention of that in the formal definition above.· I found it by just guessing that MSB is also available.· Is there a way to indicate that:

·· Symbol···· ·VAR· Word

······can also be addressed as

·· Symbol_LSB· VAR· Byte
·· Symbol_MSB· VAR· Byte


A little lower down ther is a mention of:

wordVar = lsbValue, msbValue

Am I correct in assuming the lsbValue and msbValue are just arbitrary names that indicate that the lsb should always be in the first position?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture

San Diego Miramar College

Comments

  • BeanBean Posts: 8,129
    edited 2006-08-02 18:04
    John,
    Yes, the aliases wordvar_LSB and wordvar_MSB are automatically created for any word variable.

    Let's say you have a bytevar and you want to make a wordvar = bytevar * 256. You could do

    wordvar = 0, bytevar

    This would be the same as:

    wordvar_LSB = 0
    wordvar_MSB = bytevar

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "You're braver than you believe, stronger than you seem, and smarter than you think" Christopher Robin to Pooh
    ·
Sign In or Register to comment.