Ok, this does something different than I understood you needed; you are
not converting to a binary external representation but you basically
need to parse a hexadecimal ascii representation to an array of unsigned
bytes.
Judging from your implementation, I'd say that roughly a factor 2--3
gain is still possible (that's without a lookup table, which I think
will be prohibitively big). Before we go down that road, please explain
where you get SBUF from, is it directly coming from a serial controller?
Is its value reliable (i.e., what should happen if SBUF contains a
character other than '0'..'9', 'A'..'F')?
And: what happened to the 64-byte length of buffer? This could yield 32
bytes of information, but not 32768.
In short, in order to squeeze every last bit of performance out of the
compiler for your problem, more problem-specific context is needed.
Regards, Sidney
Okay here's a little explenation and background info.
This is for a little project which somebody dumped on mu desk. The
idea is to have a 8051 derative (Infineon 80c515A) process audio at
8bit mono 8khz.
There is a preprocessor which converts the binary wavefile to hex and
strips the header/footer. Don't ask me why, it wasn't my idea. In my
opinion it would be much simpeler if the preprocessor would just dump
everything to the serialport, now we go from bin=>hex - serial -
hex=>bin. The preprocessor is out of my range. In the docs it's
specified that the preprocessor will check the stream for errors and
such, so I don't have to worry about that.
What happens when the microcontroller receives the data over the
serialport? First of all a interupt is generated, the data on the
serial line is placed in SBUF (a special function register) and the
processor jumps to the interuptvector depending on it's priority.
Why the 32k length of the buffer? I don't know why...

The thing has
64k of memory so I just took half of that, remember this is just
version 0.000000001a. I was thinking of building a dynamic listm but
that seriously cuts in on the available memory. For instance:
struct mem_byte {
char mem;
char *next_byte;
};
So I need a byte for storing the info and I need a byte for storing
the adres of the next byte. That's double...
Anywayz, I'll just run over to the guyz who are did the preprocessor
and "ask" (read yell and order) them if it isn't better for them to
just dump binary data on the line.
Anywayz, tnx for your help. You guyz got a nice little group going
here
grtz,
GIR