Solved Question Bank For ct2 Mic
Solved Question Bank For ct2 Mic
1.MOVSB / MOVSW :
Move String Byte or String Word
A string of bytes stored in a set of consecutive memory locations is to be moved
to another set of destination locations.
The starting byte of source string is located in the memory location whose
address may be computed using SI (Source Index) and DS (Data Segment)
contents.
The starting address of the destination locations where this string has to be
relocated is given by DI (Destination Index) and ES (Extra Segment) contents.
ALGORITHM
1. Data initialization
2. Load N1 no.in AX
3. Load N2 no.in BX
4. Multiply in BX
5. Store result in AX and DX.
6. END
7. Draw the Machine language instruction format for Register to Register transfer and state
the function of each bit.
8. Write an ALP to perform 16-bit division of unsigned numbers.
DATA SEGMENT
NUM DW 50H
ONES DW ?
RESULT DW ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV CX,02H
MOV AX,NUM
UP: ROR AX,1
JC DOWN
INC ONES
DOWN: LOOP UP
MOV AX, RESULT
MOV AH,4CH
INT 21H
CODE ENDS
END START
10.Write an ALP to count the number of positive and negative numbers in array.
DATA SEGMENT
DATA SEGMENT
NUM DB 10H
POS DB ?
NEG DB ?
RESULT DB ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV AL,NUM
ROL AL,1
JNC DOWN
ROL AL,1
MOV POS,AL
General Form :
Procedure Name PROC
-------------------------------------
Procedure Statements
-------------------------------------
Procedure Name ENDP.
15.Give the difference between Inter segment and Intra segment CALL.
16.Compare Procedure and macro based on i) length of code ii) generation of object code
iii) Calling method iv) Passing parameter.
Ans:
In some situation it may happen that Procedure 1 is called from main program
Procrdure2 is called from procedure1And procedure1 is again called from procdure2.
In this situation program execution flow re-enters in the procedure1. These types of
procedures are called re-entrant procedures.
A procedure is said to be re-entrant, if it can be interrupted, used and re-entered
without losing or writing over anything.,
18.What is the difference between Near and Far Procedure?
19.Define Macro.
20.Write an ALP for addition of two 8 bit BCD numbers using MACRO.
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
NUM1 DB 04H
NUM2 DB 06H
BCD_SUM DB ?
DATA ENDS
CODE SEGMENT
START:MOV AX,@DATA
MOV DS, AX
MOV AL, NUM1
MOV BL, NUM2
ADD AL,BL
DAA
MOV BCD_SUM, AL
MOV AH,4CH
INT 21H
ENDM
ENDS
END START