2012-08-11 2 views
1

내가 바이트의 RGBA 버퍼로 바이트의 RGB 버퍼 압축을 풀 ++ 2010 VC에서 일부 인라인 어셈블리를 만들려고 해요 내가 가지고 올 한 것을, 여기 :오류 VC++ 2010

그러나

void RGBtoRGBA (byte *rgba, const byte *rgb, int pixelCount) { 
    __asm { 
     MOV EDX, pixelCount 
     MOV EBX, rgba 
     MOV ECX, rgb 
     loop: 
      MOV [EBX], ECX 
      MOV [EBX+1], [ECX+1] 
      MOV [EBX+2], [ECX+2] 
      MOV [EBX+3], 255 
      ADD EBX, 4 
      ADD ECX, 3 
      DEC EDX 
      JNZ loop 
    } 
} 

나를 용서, 내가 어셈블리에 새로운 해요 :(

: 나는 그것을 잘못 정말로 확실하지 않다

1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(28):  error C2414: illegal number of operands 
1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(28):  error C2400: inline assembler syntax error in 'first operand'; found ':' 
1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(29):  error C2400: inline assembler syntax error in 'opcode'; found ':' 
1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(29):  warning C4405: 'MOV' : identifier is reserved word 
1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(30):  error C2415: improper operand type 
1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(31):  error C2415: improper operand type 
1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(37): warning C4405: 'loop' : identifier is reserved word 
1>c:\users\tom\documents\visual studio 2010\projects\source\engine\image_load.c(71): warning C4018: '<' : signed/unsigned mismatch 

이 내 코드 오류를 얻을

답변

3

없음 범용 명령은 당신이 쓴 2 메모리 피연산자처럼 지원하지 않습니다 :

  • 레지스터 + 일정
  • 레지스터 + 메모리 :

    MOV [EBX+1], [ECX+1] 
    MOV [EBX+2], [ECX+2] 
    

    범용 지침은 일반적으로 단지이 두 피연산자 조합을 가질 수 있습니다

  • 레지스터 + 레지스터
  • 메모리 + 상수

유효한 피연산자 조합을 사용하려면 코드를 다시 작성해야합니다. 지시 사항에 대한 자세한 내용은 CPU 매뉴얼을 읽기 시작하십시오.

또한 loop은 명령어 이름입니다. 라벨 이름에는 사용하지 마십시오.