Concatenating two bytes together to into a word.
Kevin Harris
Posts: 15
Is there an elegant way to take two byte variables and concatenate them into a word. For instance, I have something like...
CMD VAR Word
ByteOne VAR Byte
ByteTwo VAR Byte
ByteOne = $A1
ByteTwo = $03
Then I want CMD to = $A103. How do I go about doing that in PBasic?
CMD VAR Word
ByteOne VAR Byte
ByteTwo VAR Byte
ByteOne = $A1
ByteTwo = $03
Then I want CMD to = $A103. How do I go about doing that in PBasic?
Comments
HB VAR cmd.HIGHBYTE
LB VAR cmd.LOWBYTE
HB = $10
LB = $20
DEBUG IHEX4 cmd
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
·???
·Update -- Scratch that.
·It works.
Post Edited (PJ Allen) : 2/2/2007 1:36:37 AM GMT