cancel
Showing results for 
Search instead for 
Did you mean: 

Compiler Error message C5691 (SLL assembly command)

alfonso2
Associate II
Posted on November 10, 2005 at 09:52

Compiler Error message C5691 (SLL assembly command)

5 REPLIES 5
alfonso2
Associate II
Posted on November 10, 2005 at 08:00

Excuse me,

when i compile my program appears an error in an assembly section of the program, the error is this:

''ERROR C5691: Instruction operand mismatch'', i am using the metrowerks compiler fo ST7, and the software is this:

unsigned char temp;

asm {

CLR X

; CLR Y

; LD A, (Buffer_Param,Y)

LD A, Buffer_Param

CALLR shifting

LD A, Buffer_Param:1

CALLR shifting

LD A, Buffer_Param:2

CALLR shifting

LD A, Buffer_Param:3

CALLR shifting

LD A, Buffer_Param:4

CALLR shifting

SCF

RLC X

LD Buffer_Param:5, X

RET

shifting:

LD temp, A

SLL X

LD A, X

XOR A, temp

JRPL shift_bit1

LD A, X

XOR A, #0x09

LD X, A

shift_bit1:

SLL temp <--- this is the error!!!

i don't understand why appears this error...the temp is a Byte variable and the SLL command is good for byte variables, then why there is a operand mismatch?

help me please....

:-? :-? :-?

[ This message was edited by: liotro78 on 10-11-2005 12:31 ]

[ This message was edited by: liotro78 on 10-11-2005 12:40 ]

fggnrc
Associate II
Posted on November 10, 2005 at 08:46

Liotro78,

SLL works only if temp address is within the zero page (0x0000 - 0x00FF).

Consult metrowerks compiler manual and find the compiler option which puts temp in this zone.

EtaPhi

alfonso2
Associate II
Posted on November 10, 2005 at 09:39

thank you very much!

i have used #pragma command and now all is ok.

But appears another new error,and i think is similar with the first.

the error is always the C5961, and now the instruction is this:

LD A , ([_LEX.w],Z)

the _LEX variable is declared in this way:

#pragma DATA_SEG SHORT _ZEROPAGE

extern short _LEX;

why this error?

i don't know very well the assembly language...excuse me..

:-[

[ This message was edited by: liotro78 on 10-11-2005 14:13 ]

alfonso2
Associate II
Posted on November 10, 2005 at 09:50

ok all ok!!

fggnrc
Associate II
Posted on November 10, 2005 at 09:52

Liotro78,

the ST7 core has only A, X and Y registers to hold data...

EtaPhi