CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Loading 13 bits to PORTD

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Bryan
Guest







Loading 13 bits to PORTD
PostPosted: Thu Jul 31, 2003 10:48 am     Reply with quote

Hi!
If i load long integer variable to PORTD, which part of byte (upper or lower) will be loaded to PORTD? Thanks in advance.

bryan
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516523
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: Loading 13 bits to PORTD
PostPosted: Thu Jul 31, 2003 10:56 am     Reply with quote

Lower byte unless you do something like (int8)(x>>8) where x is a long (16bit).
:=Hi!
:= If i load long integer variable to PORTD, which part of byte (upper or lower) will be loaded to PORTD? Thanks in advance.
:=
:=bryan
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516524
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

Re: Loading 13 bits to PORTD
PostPosted: Thu Jul 31, 2003 11:01 am     Reply with quote

:=Hi!
:= If i load long integer variable to PORTD, which part of byte (upper or lower) will be loaded to PORTD? Thanks in advance.
:=
:=bryan
A way to find an answer and gain insight is to look at the .lst file which is generated. You'll see which part is moved to portD
when you in c code assign a 16 bit value to an 8 bit port.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516525
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group