Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Combining two 8-bit values

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
atrueland

Bascom Member



Joined: 12 Jan 2005
Posts: 3

PostPosted: Wed Jan 12, 2005 10:19 pm    Post subject: Combining two 8-bit values Reply with quote

How can I combine two 8-bit values into one 16-bit value? One example is to read two ports and combine the data into one 16-bit word. One port would be the low byte and the other port would be the high byte. Can it be done in BASIC, or does it have to be done in assembly. I know a function exists in Bascom to split a 16-bit value into to 8-bits values, but what is its compliment? Question

atrueland
Back to top
View user's profile
DToolan

Bascom Member



Joined: 14 Aug 2004
Posts: 1384
Location: Dallas / Fort Worth, Texas (USA)

blank.gif
PostPosted: Wed Jan 12, 2005 10:26 pm    Post subject: Reply with quote

WordVar = MAKEINT(LSB_Var , MSB_Var)
Back to top
View user's profile Yahoo Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum