mov

DirectX8

Microsoft DirectX 8.1 (pixel shader versions 1.0, 1.1, 1.2, 1.3, 1.4)

mov

Copies the contents of the source to the destination.

mov dest, src

Registers

Argument Description RegistersVersion
vn cn tn rn
dest Destination register x 1.0
x x 1.1, 1.2, 1.3
x 1.4
src Source register x x x x 1.0, 1.1, 1.2, 1.3
x x 1.4 phase 1
x x x 1.4 phase 2

To learn more about registers, see Registers.

Example

This example is for illustration only. The C code accompanying the shader has not been optimized for performance. It can use helper functions from the Sample Framework. The sample framework is the foundation on which many of the samples are built.

// This example copies the texture color to the output.

// The shader is shown below.
ps.1.0          // Version instruction
tex t0          // Declare texture.
mov r0, t0      // Move texture to output.

// The following images show the contents of the source register and 
// the resulting destination register. The images are identical because 
// the mov instruction was used.

// Additional code loads the texture in texture stage 0.
LPDIRECT3DDEVICE8   m_pd3dDevice;   // Init this device pointer in the application.
LPDIRECT3DTEXTURE8  m_pTexture0;    // Use this variable to hold a pointer to the texture.
TCHAR               strPath[512] = "textureFile.jpg";

D3DUtil_CreateTexture( m_pd3dDevice, strPath, &m;_pTexture0, D3DFMT_R5G6B5 );
m_pd3dDevice->SetTexture( 0, m_pTexture0 );