News:

  • June 08, 2026, 03:10:18 AM

Login with username, password and session length

Author Topic: MOVER, casts, and truncation  (Read 6001 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
MOVER, casts, and truncation
« 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.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: MOVER, casts, and truncation
« Reply #1 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

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: MOVER, casts, and truncation
« Reply #2 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.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.