本帖最后由 jmg 于 2024-5-15 10:37 编辑
LAO*** published on 2024-5-15 08:36
Regarding the left shift of MDU32C logic, there is a small problem. With a patch, it can still be used. The speed is N times faster than the software algorithm that comes with Keil C51.
> "6. Add 32-bit exchange instructions (R0R1R2R3<-->R4R5R6R7). "
Yes, the present MDU32C opcodes seem backwards.
I tried a simple DDS using this, where you add a increment to a 32b value, to give an table index pointer. That shows a problem :
R4..R7 = R4..R7 + R0..R3 is not much use.
Better would have been swapped operands, so
R0..R3 = R4..R7 + R0..R3 is better.
With this swap, you can set R4..R7 as fixed adder, and
Add32b
MOX A,@R0
MOV DAC_SFR,A 复制代码
for upper 8 bits index, already in R0, into XDATA page, or
Add32b
MOX A,@R0
MOV XDATA_Page,A
MOX A,@R1
MOV DAC_SFR,A
复制代码
for using all XRAM as table, upper 13b index is R0,R1 for a 29b adder