Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Controls Guy on June 25, 2021, 07:24:58 PM

Title: MOVER, casts, and truncation
Post by: Controls Guy on June 25, 2021, 07:24:58 PM
MOVER truncates larger values to fit in smaller registers, from the LS end.   Can I force it to move the high-order extraction cast register from each DWORD by doing MOVER D0:W1 8 MHR80, thus getting the high word of 8 consecutive DWORD locations, or is it going to think I mean 8 consecutive WORD registers in D?

I want to do the first thing.
Title: Re: MOVER, casts, and truncation
Post by: franji1 on June 26, 2021, 07:23:37 AM
Sorry, it will do othe latter.  It won't skip every other word in a DWORD.  It would move contiguous WORD sized elements from D.

Use a FOR/NEXT loop to skip
FOR V0 0 to 7
MATH MHR[80+V0] D[V0]:W1
Title: Re: MOVER, casts, and truncation
Post by: Controls Guy on June 26, 2021, 10:54:24 AM
I assume it would do that too for MOVER D0:W0, because the source element size is now WORD?

I knew I could do a loop, but it felt too heavyweight for the purpose.  I ended up moving all 8 DWORDS intact and just picking through the destination, in fact even used MEMCOPY instead of MOVER, since I didn't need the value-awareness.