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 CCS Technical Support

Asm to C ccs

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







Asm to C ccs
PostPosted: Mon Nov 29, 2004 3:16 am     Reply with quote

Hi all
Please help ? I have asm as follow how to convert to c CCS and resault is same. Thank you in advance.



onCounter equ 0x20
onPacket equ 0x22


movlw D'12'
movwf onCounter
movlw onPacket
movwf fsr
Ai1: clrf indf
incf fsr,f
decfsz onCounter,f
goto Ai1
call xxxxxx
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Mon Nov 29, 2004 9:34 am     Reply with quote

It's hard to say without getting the code in context. The code generated by 'memcpy' may be what you want.
Mark



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

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

PostPosted: Mon Nov 29, 2004 9:58 am     Reply with quote

Code:

int onPacket[12];
int onCounter;

for (onCounter=0;onCounter<12;onCounter++)
{
  onPacket[i] = 0;
}


or
Code:

int onPacket[12];
int *ptr_onPacket;
int onCounter;

ptr_onPacket = onPacket;
for (onCounter=0;onCounter<12;onCounter++)
{
  *ptr_onPacket = 0;
  ptr_onPacket ++;
}
masterat
Guest







PostPosted: Thu Dec 02, 2004 2:12 am     Reply with quote

Thank you for help .
Help more please . I need sample c for control cdrom please advise or post sample .Thank again .
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