View previous topic :: View next topic |
Author |
Message |
masterat Guest
|
Asm to C ccs |
Posted: Mon Nov 29, 2004 3:16 am |
|
|
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
|
|
Posted: Mon Nov 29, 2004 9:34 am |
|
|
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
|
|
Posted: Mon Nov 29, 2004 9:58 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 2:12 am |
|
|
Thank you for help .
Help more please . I need sample c for control cdrom please advise or post sample .Thank again . |
|
 |
|