On Wed, Oct 15, 2003 at 07:29:13PM +0400, Dmitry wrote:
> So, where is the bug?
> In a source code? :)
> ~d
mspgcc does not put 'cmp #0,@r15' :)
So, where is the bug?
In a source code? :)
~d
On Wednesday 15 October 2003 18:42, Betoes wrote:
> Yes, you are right, BUT comparing above code to C instructions, as in
> pzn mail, the correct cmp opcode is:
>
> cmp #0,@r15
>
> and not:
>
> cmp #0,r15
>
> Because, at this point, r15 has the pointer
On Wed, Oct 15, 2003 at 09:49:18AM -0400, Jacob Welch wrote:
> Pedro Zorzenon Neto wrote:
>
> > Code generated by mspgcc:
> >
> >.L3:
> > mov &menu_i, r15 ; Load 'menu_i' into r15
> > rla r15 ; Rotate Left twice to adjust
> > index
> >
the compiler tries to compare '@r15' against zero which is correct.
previous add instruction sets Z flag and mov insn does not affect it,
therefore 'cmp #0, 0(r15)' may be ommited.
To be honest -- mov @r15, r15 is redudant here and a result of no
optimization.
cheers,
~d
On Wednesday 15 Octobe
Pedro Zorzenon Neto wrote:
Code generated by mspgcc:
.L3:
mov &menu_i, r15 ; Load 'menu_i' into r15
rla r15 ; Rotate Left twice to adjust index
rla r15 ; into a memory offset (element size
is 4)
Pedro Zorzenon Neto wrote:
In the assembler, there is no "cmp" after "mov", and msp user guide
tells that "mov" opcode does not affect Z flag.
The ADD is the instruction that affects the Z flag, and since the MOV
doesn't alter Z, it is still intact when the JNE is executed. Mspgcc
looks l