56303 INSTRUCTIONS PROBLEMS

56303 INSTRUCTIONS PROBLEMS

Post by IM » Thu, 03 Jun 1999 04:00:00



    Hi all,

    I have a couple of questions about the 563x core instructions, I hope
someone could help me:

    1 -  when I get into a DO loop like

                DO      #16,LABEL

            The number of iterations it will do is 15 or 16?, I've seen that
when it copyes the number 16 to the LC register it decrements this one so
that makes the number of iterations one less that the number specify, does
that the same happens with the instruction REP .

    2 -  I have serious problems using the comand

                CMP
                JCLR      #0,X:(Rn)+,LABEL

            Well the problem this time is that this never jumps to the label
when the bit 0 is cleared as it should do, I hope someone could have had the
same problem before.

    Thank you very mutch,

    IMG

 
 
 

56303 INSTRUCTIONS PROBLEMS

Post by Bart Brun » Thu, 03 Jun 1999 04:00:00



>    Hi all,

>    I have a couple of questions about the 563x core instructions, I hope
>someone could help me:

>    1 -  when I get into a DO loop like

>                DO      #16,LABEL

>            The number of iterations it will do is 15 or 16?, I've seen
that
>when it copyes the number 16 to the LC register it decrements this one so
>that makes the number of iterations one less that the number specify, does
>that the same happens with the instruction REP .

Your loop is executed 16 times, not 15.

Quote:

>     2 -  I have serious problems using the comand

>                 CMP
>                 JCLR      #0,X:(Rn)+,LABEL

>             Well the problem this time is that this never jumps to the
label
> when the bit 0 is cleared as it should do, I hope someone could have had
the
> same problem before.

You should realise that bit 0 of location X:(Rn) is tested. The result of
the previous CMP instruction is not relevant.

BTW you will be able to check both things using the simulator or de*.

Good luck,

Bart

 
 
 

56303 INSTRUCTIONS PROBLEMS

Post by appadwedula swaroo » Thu, 03 Jun 1999 04:00:00


Dear IMG,


>     Hi all,

>     I have a couple of questions about the 563x core instructions, I
hope
> someone could help me:

>     1 -  when I get into a DO loop like

>                 DO      #16,LABEL

>             The number of iterations it will do is 15 or 16?, I've seen
that
> when it copyes the number 16 to the LC register it decrements this one
so
> that makes the number of iterations one less that the number specify,
does
> that the same happens with the instruction REP .

        Both "DO #16,LABEL" and "REP 16" will run the instruction(s) in
the loop 16 times NOT 15 times.  The LC gets loaded with the value 16 and
is decremented to zero at which point the loop ends.

Quote:

>     2 -  I have serious problems using the comand

>                 CMP
>                 JCLR      #0,X:(Rn)+,LABEL

>             Well the problem this time is that this never jumps to the
label
> when the bit 0 is cleared as it should do, I hope someone could have had
the
> same problem before.

        If you are using the EVM56K de*, this problem may be related
to stepping through each instruction.  I have found that putting break
points at the possible destinations points of the jumps and using "GO"
works while single stepping does not work.  I'm not sure why???  Of
course, if you get any interrupts (from the A/D etc..) between the CMP and
the JCLR, then the status register (SR) may be modified.  

        I hope this helps.

                                                -Swaroop

 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


 Digital Signal Processing Group        office: (217) 244-0575
 University of Illinois                 home:   (217) 278-3042

- Show quoted text -

Quote:

>     2 -  I have serious problems using the comand

>                 CMP
>                 JCLR      #0,X:(Rn)+,LABEL

>             Well the problem this time is that this never jumps to the label
> when the bit 0 is cleared as it should do, I hope someone could have had the
> same problem before.

>     Thank you very mutch,

>     IMG

 
 
 

56303 INSTRUCTIONS PROBLEMS

Post by Andrew Reil » Thu, 03 Jun 1999 04:00:00




Quote:>     1 -  when I get into a DO loop like

>                 DO      #16,LABEL

>             The number of iterations it will do is 15 or 16?, I've seen that

16.

On the '30x (but not the '002) you can even have zero-count DO
loops.

Quote:> when it copyes the number 16 to the LC register it decrements this one so
> that makes the number of iterations one less that the number specify, does

It's hardly ever handy to look at the value in the LC register,
so you should check the manual for details if you do.  The
argument is the number of iterations.

Quote:> that the same happens with the instruction REP .

REP holds off interrupts, and can therefore be bad for your health.
The argument is the number of iterations (but zero is not allowed
here).

Quote:>     2 -  I have serious problems using the comand

>                 CMP
>                 JCLR      #0,X:(Rn)+,LABEL

>             Well the problem this time is that this never jumps to the label
> when the bit 0 is cleared as it should do, I hope someone could have had the
> same problem before.

Not shure what you mean by CMP, there.  I'll ignore it...

The jclr instruction usually works fine for me.  Don't forget
that bits number according to numerical significance here, so #0
is the least significant bit of X memory addressed by Rn.

Also, single stepping with the in-circuit emulator can be
confusing here, because it always appears as though the branch
is taken, even if it isn't.  The processor does the right thing
on the next "step" command.

--
Andrew Reilly

 
 
 

56303 INSTRUCTIONS PROBLEMS

Post by robert bristow-johnso » Thu, 03 Jun 1999 04:00:00



>     Hi all,

>     I have a couple of questions about the 563x core instructions, I hope
> someone could help me:

>     1 -  when I get into a DO loop like

>                 DO      #16,LABEL

>             The number of iterations it will do is 15 or 16?, I've seen that
> when it copyes the number 16 to the LC register it decrements this one so
> that makes the number of iterations one less that the number specify, does
> that the same happens with the instruction REP .

the number of iteraions is 16.  same for REP.

Quote:>     2 -  I have serious problems using the comand

>                 CMP
>                 JCLR      #0,X:(Rn)+,LABEL

>             Well the problem this time is that this never jumps to the label
> when the bit 0 is cleared as it should do, I hope someone could have had the
> same problem before.

what, exactly is register Rn pointing to before the instruction is
executed?  let's say that n=1 (jclr #0,x:(r1)+,LABEL ), and that r1 =
$0100 .   if x:$0100 contains an even number, then JCLR will jump to the
LABEL and r1 will be incremented to $0101 .

--

r b-j


"Don't give in to the Dark Side.  Boycott intel and microsoft."

 
 
 

56303 INSTRUCTIONS PROBLEMS

Post by Marc Lindahl/Sonoru » Fri, 04 Jun 1999 04:00:00


----------


> Of
>course, if you get any interrupts (from the A/D etc..) between the CMP and
>the JCLR, then the status register (SR) may be modified.  

A long interrupt saves and restores the SR
A short interrupt can of course mess up the SR
But also JCLR tests the memory location and thus invalidates the CMP.  Maybe
the original poster intended to use a JCC?


president, Sonorus Inc.
http://www.sonorus.com

 
 
 

1. 56303 reset problems

We are using the latest version of the 56303 and having problems getting
the reset to work.  Power-up resets the device thanks to the device's
schmidt trigger, but on reset pulse, it seems to be in a permanent state
of booting.  

We are using the latest rev 56303 device.  We connect the reset signal
to the reset input and the ONCE/JTAG TRST line.  We have driven it from
a 5V source using a MAX705 supervisor circuit and have verified the
signal on the scope.  

The emulator resets the device just fine and it connects to the same
reset line.

2. FS2K2 Flightplanners & Utilities

3. Motorola DSP 56303 compiler bug

4. Claus' CPUXA questions:

5. Newbie: WTB Motorola 56002/56303 EVM

6. The Skin on my PSION 5 is pealing off.

7. Motorola 56303, HI08 question

8. programming FT search on a view

9. Am I wasting my time with the 56303 and cdemo.c?

10. DSP 56303 help

11. ISP and Debugging Tools for Motorola 56303

12. motorola 56303 host port HI08