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

How to access int16 from assambly

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







How to access int16 from assambly
PostPosted: Wed Dec 12, 2001 5:57 am     Reply with quote

Hello

I am trying to use int16 variables in assambly. This has been taken from the reference manual:

int count;
#asm
movlw 0x8
movwf count
...

How can I access both int16 high and low bytes?

Thank you
Javier
___________________________
This message was ported from CCS's old forum
Original Post ID: 1588
Tomi
Guest







Re: How to access int16 from assambly
PostPosted: Wed Dec 12, 2001 11:27 am     Reply with quote

int16 count;

count = 0x5678;
#asm
movlw 0x12
movwf (&count+1)
movlw 0x34
movwf count
#endasm

The list (see the difference Smile ):
.................... count = 0x5678;
0027: MOVLW 56
0028: MOVWF 22
0029: MOVLW 78
002A: MOVWF 21
.................... #asm
.................... movlw 0x12
002B: MOVLW 12
.................... movwf (&count+1)
002C: MOVWF 22
.................... movlw 0x34
002D: MOVLW 34
.................... movwf count
.................... #endasm
002E: MOVWF 21


:=Hello
:=
:=I am trying to use int16 variables in assambly. This has been taken from the reference manual:
:=
:=int count;
:=#asm
:=movlw 0x8
:=movwf count
:=...
:=
:=How can I access both int16 high and low bytes?
:=
:=Thank you
:=Javier
___________________________
This message was ported from CCS's old forum
Original Post ID: 1594
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