Hello,
I have just started working with the SHARC DSP recently and have
mainly been using C++ through VDSP++. However, now I am trying to write
some simple mathematic tests in assembly, just to check some of the ALU
ops that I'm not sure how to check through C and to become familiar with
the assembly language used by Analog Devices. Anyway, I have reached an
impass...
I wrote a simple subtraction problem just to get the basics down.
Originally, this was much longer and more involved, however it didn't
work... so I kept trimming it down until I was left with a single ALU
operation, but the problem has not gone away...
#include "def21160.h"
.segment/DM seg_dmda;
.endseg;
.segment/PM seg_pmda;
.endseg;
.segment/PM seg_pmco;
.global _main;
_main:
f2;
f3B;
f4f2;
.endseg;
It compiles just fine, but when I go to run it through the debugger I
get an error that reads "PC Stack Underflow" I'm not entirely
sure why
it is doing this, since it makes it to the end of the program just fine,
and the registers seem to have the right values in them. Also, the
program has no loops, so I don't know why it should be doing anything
that would cause it to crash. I've never seen an underflow before, so
I'm at a loss. Any ideas what I might have done wrong? I have tried
using different registers, using #define to create symbols to use, and a
few other things, but they all do the same thing when I try to run it.
Another thing I noticed is that if I change _main to anything else, it
won't compile. I get an error saying that _main is referenced by one of
the headers in the 21xx library (not the one that I am directly calling
in the program, either). The thing that confuses me about this is that
other sample files I have downloaded from various sites online have not
had this same error. Could this be a problem with how I have the linker
configured?
The platform I am using is Windows 95, VDSP++ IDE v 3.0.1.0. (I'm not
sure if that matters or not, but it probably couldn't hurt). Any advice
would be greatly appreciated.
thanks,
Tom
|