hi, all,
    I write a inline asm function,strCmp(char * s1, char * substr,uint
len), mixed with c in CW, s1 is a ptr to the data of  DB record and
substr is local str ptr. I found the asm cannot work due to the s1. is
there any data segment offset for DB? why in the asm function, s1 cannot
get the right value?

Boolean asm strCmp(unsigned char *sj, unsigned char *substr, UInt len)
{
 fralloc+

 //A1 = s + j
 move.b #1, D0
 move.l sj, A1
 //A4 = substr
 move.l substr, A2
 move.w len, D1
@strncmp:
 subi.w #1, D1
 //check -1, the strings are equal
 tst.w D1
 bmi @success

 cmp.b (A1)+, (A2)+
 beq @strncmp
 jmp @exit

@success:
 move.l #0, D0

@exit:
 frfree
 rts
}

I use this to call it:

   if(strCmp((unsigned char *)(s+j),
    (unsigned char *)substr, len) == 0)
   {
    WinDrawChars("yeah", 4, 50, 30);
   }

    Thanks a lot!!!!

Eric



-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to