Professional Documents
Culture Documents
[IST ,6d][2014,6d]
1. MOV: The MOV instruction copies a word or byte of data from a specified source to a specified
destination.
XCHG: The XCHG instruction exchanges the content of a register with the content of another
register or with the content of memory location(s).
2. MOV: The destination can be a register or a memory location. The source can be a register, a
memory location or an immediate number.
XCHG: It cannot directly exchange the content of two memory locations.
3. MOV : The source and destination cannot both be memory locations. They must both be of the
same type (bytes or words). MOV instruction does not affect any flag.
XCHG: The source and destination must both be of the same type (bytes or words). The segment
registers cannot be used in this instruction. This instruction does not affect any flag.
Restriction:
For technical reasons, there are a few restrictions on the use of MOV and XCHG.
In particular that a MOV or XCHG between memory locations is not allowed.
For example,
ILLEGAL: MOV WORD1,WORD2
but we can get around this restriction by using a register:
MOV AX,WORD2
MOV WORD1, AX
2. Describe different types of JUMP instructions with proper examples?
3. Write down the assembly language statements which will perform the following operation:
[2012,4a]
1) Puts the offset address of the variable MSG into DX
2) Initialize the DS
3) Subs tract 0001H from 8000H and store the result in AX
2) MOV AX,@DATA
MOV DS,AX ; Initialize DS
4. Write down the assembly language statements which will perform the following operation:
[2013,4a]
1) Read a character and if it’s an uppercase letter ,display it
2) Read characters until a blank is read
5. Describe the operation of each of the following instruction and identify their addressing
mode:-
(1) LEA BP , 7986H;
(2) MOV [AL] , 39H;
(3) CMP [DS] , [CX] .
ANS:
.MODEL SMALL
.STACK 100H
.DATA
M1 DB 'NATIONAL UNIVERSITY',0DH,0AH,'$'
.CODE
MOV AX,@DATA
MOV DS,AX ; initializing text to data register
JNZ PRINT_LOOP
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS ,AX
LEA DX,MSG
MOV AH,9
INT 21h
MOV AX,4CH
INT 21H
MAIN ENDP
END MAIN
8. Write an assembly language program to show your university name 10 time on screen.
[2013,7c]
ANS:
.MODEL SMALL
.STACK 100H
.DATA
M1 DB 'Institute of Science, Trade & Technology (ISTT)',0DH,0AH,'$'
.CODE
MOV AX,@DATA
MOV DS,AX ;initializing text to data register
JNZ PRINT_LOOP
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN