Re: 8051 Speed Optimization



Tilmann Reh schrieb:

> You could also use CJNE for the comparison - it also sets carry, but is
> non-destructive, so you don't need to reload A from XRAM for each test:
>
> movx a,@dptr
> cjne a,ar0,$+3
> mov mDataOut.0,c
> cjne a,...
> mov ...,c

I forgot to mention: The polarity of the output bits is opposed to that
of your code. You'd have to negate the data before comparison or CPL the
output bits afterwards (if you can't switch the polarity otherwise).

--
Dipl.-Ing. Tilmann Reh
http://www.autometer.de - Elektronik nach Maß.
.