MOV Instruction

MOV instruction normally used to copy the data from one location to another. Let’s take an example of it.

MOV destination, source; it will copy the content of destination to the source

For example, if the destination of the data is AX register and the source is CX. Then we’ll write the command in the following way

MOV AX, CX; it will copy the content of CX to AX

We can also directly load the value into the non-segment.

MOV AX, 461EH; it will move 461E to AX

MOV BX, 461EH; it will move 461E to BX

MOV CX, 461EH; it will move 461E to CX

MOV DX, 461EH; it will move 461E to DX

After all these above-mentioned commands the data in AX, BX, CX, DX will be equal to 461E. H represents here the hexadecimal.

There is one to thing to be noticed here that data cannot be directly loaded into segment registers(CS, DS,ES,SS). For placing the data into segment registers we’ll have to move it to non-segment register first and then move it to segment register from non-segment register. The segment registers here include CS, DS, ES, SS.

MOV AX, 145FH; it will load 145F to AX

MOV DS, AX; it will copy the content of AX to DS.

As in the above-mentioned example, DS is a segment register so we cannot directly load the data into it. We’ll have to load it first into non-segment register AX and then move it to segment register DS.

If we move a value less than FFH into a 16-bit register, then the rest of the bits will remain 0

MOV AX, 05; it will move 05 to AX

In the above mentioned AH = 00 and AL = 05.

Let’s say we move that we’ll move a value greater than FFFFH into a 16-bit register then it will cause an error.

MOV AX,56FE8; ILLEGAL: The value is too large.

Related posts

Leave a Comment