Pelles C forum

Assembly language => Assembly discussions => Topic started by: endof on January 20, 2015, 03:46:53 PM

Title: error #3151: [asm] Syntax error.
Post by: endof on January 20, 2015, 03:46:53 PM
My dll is not build. It show me error #3151: [asm] Syntax error. in this lines
      cmp   byte [eax], '#';
      cmp   byte [eax + 5], ',';
      cmp   byte [eax + 7], ',';

What i must do for resolve it problem?

code:

void __declspec(naked) ColorSysMessageAddOn(void){
   __asm{
      cmp   byte [eax], '#';
      jnz    _without_format; 
      cmp   byte [eax + 5], ',';
      jnz    _without_format;
      cmp   byte [eax + 7], ',';
      jnz    _without_format;
      mov       edx, [eax+1];      //color
                  and       edx, 0x40404040;
                  shr       edx, 6;
                  lea        edx, [edx*8+edx];
                  add       edx, [eax+1];
                  and       edx, 0x0F0F0F0F;
                  mov       eax, edx;
                  shl       eax, 12;
                  or        edx, eax;
                  mov       eax, edx;
                  shr       eax, 24;
                  and       edx, 0xFF00;
                  or        eax, edx;
      mov   edx, [esp+0x04];    //string
      xor    ebx, ebx;
      mov       bl, byte [edx+6];    //font
      and   bl, 0xf;
      push       ebx;   //font
      push       0;   //talk mode
      push       eax;   //hue
      push       0;   //obj
      add   edx, 0x08;
      push   edx;   //szTzt
      call   CClient_addBark;
      ret   0x04;
   _without_format:
      jmp   CChar_addSysMessage;   
   }      
}

Thanks for your help!
Title: Re: error #3151: [asm] Syntax error.
Post by: Grincheux on March 19, 2015, 06:21:36 PM
Try



CMP  BYTE PTR [eax], '#'