أسئلة أسمبلي اختر

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

1- A CPU running at 40 MHz would have a clock period of nanoseconds.

a.15

b.None of these

c.200

d.30

e.2r50

f.25
2- Considering that the code for AX=00, CX=10,[BX]=100, [xxxx]=110,
constant=111 add=101 and sub=100 ,
What is the corresponding machine code for the instruction: Add CX,AX ?

a.10100010

b.10101000

c.10110000

d.10100100
3- In control bus, the following read and write line signals are valid except ---------

a.Read Line=0 and write line =0

b.None of these

c.Read line =1 and write line =0

d.Read line =1 and write line =1

e.Read line=0 and write line =1


4- Consider the following information, CS= 60BC, and IP=00EA, calculate the instruction
address, then select the correct answer:

a.60CAA

b.60CCA

c.60CBA

d.60BAA

e.None of these
5- System Bus Contains:

a.Address bus, data bus and control bus

b.Data bus and control bus

c.Address Bus

d.None of these

e.Control Bus

f.Data Bus

g.Address bus and data bus


6- which is the size of address bus needed to address memory of size 64MB

a.16 bits

b.36 bits

c.25 bits

d.26 bits
7- Consider the following information, DS=2FACH , and IP=7E33H, calculate the data
address, and then select the correct answer:

a.812DB

b.ADDE0

c.378F3

d.ADDE
8- Memory address refers to the successive memory words and the machine is called as .......

a.Word addressable

b.Terra byte addressable

c.None of these

d.Bit addressable

e.Byte addressable
9- Assume that AX = 254, and the following instruction ADD AX, 1; then the flag register
CF= and AF will be
a.None of these

` b.CF=0 and AF=0

c.CF=1 and AF=0

d.CF=0 and AF=1

e.CF=1 and AF=1


10- Convert the logical address 24B2:26AC to physical address.

a.4B5E0H

b.271CCH

c.4B5EH

d.271DCH
11- If a, b, and c are 8-bit numbers (defined with db directive), Choose one of
assembly code equivalent to a = a*b%c

a.
mov AX,a
mul b
div c
mov a,AX

b.
mov AL,a
div c
Mul b
mov a,AL

c.
mov AL,a
mul b
div c
mov a,AL

d.
mov AL,a
mul b
div c
mov a,AH
12- If AL contains +124 and you add 3 to AL, the Overflow flag will be set.

a.False

b.True
13- The PROC directive marks the beginning of a procedure WHILE the END directive marks
the termination of the procedure.

a.False

b.True
14- An identifier in assembly language may contain other characters besides letters and
digits

a.False

b.True

15- Instruction mov ax, [500] represents...............................addressing mode

a.Direct

b.Register

c.Indirect

d.Constant

e.None of these

16- Assume that X is defined as an identifier, then the following code


mov ah,02h
Mov dl,x
Int 21h

a.prompt the user to enter a value from keyboard

b.display the ascii character represented by the value in X

c.None of these

d.display the value of X on the screen


17- Given the following code (Note that the ASCII of ‘n’ =110)
mov al,”n”
Add al,9
And al,11011011b
then the value in AL register is …………………………………..

a.‘R’

b.‘s’

c.None of these

d.‘53’

e.‘r’

f.‘S’
18- Set when carry out of bit 3 in the destination operand

a.Auxiliary Carry flag

b.Parity flag

c.Carry flag

d.Overflow flag
19- if AX contains decimal -2 and BX contains decimal 2 then after the execution of
instructions: CMP AX, BX JA label

a.ZF will contain value -4

b.None of these

c.Jump will be taken

d.Jump will not be taken

e.Zero flag will set


20- The 80x86 family has three major busses,__________________ ,data Bus, and address Bus

a.signal Bus

b.instruction Bus

c.control Bus

d.status Bus
21- Clock cycle is another name for machine cycle.

a.TRUE
b.FALSE
22- For accessing 16-bit (word) data at the address [200BAH] from Main
Memory (even Bank, odd Bank) , What will be the values of A0 and BHE?
(NOTE: IF the ACCESSING NEEDS TWO MEMORY BUS CYCLE, identify the
state of A0 and BHE at first cycle)

a.A0=1 and BHE=0

b.A0=0 and BHE=1

c.A0=1 and BHE=1

d.A0=0 and BHE=0

23- ___________________ points at the segment containing the currently executing machine
instructions.

a.ES

b.CS

c.SS

d.DS
24- Which of the following will terminate a program and return to MS-DOS:

a.
mov ax, 4c00h
int 21h

b.None of these

c.
mov ax, 9h
int 22h

d.
mov ax, 4c00h
int 20h

e.
mov dx, 4c00h
int 21h
25- The control unit (CU) coordinates the order in which computer instructions are executed.
a.FALSE

b.TRUE

26- You have given the following code, what will be then Ah=…………. And Al=…………

a.AH=5 and AL=0

b.AH=0 and AL=5

c.None of these

d.AH=5 and AL=5

27- Set when carry out of sign bit is not equal to carry in to sign bit

a.Carry flag

b.Parity flag

c.Auxiliary Carry flag

d.Overflow flag

28- ___________________ describes what the computer does and deals with high-level design
issues.

a.Computer Design

b.Computer Structure

c.Computer Architecture

d.Computer Organization
29- BHE of 8086 microprocessor signal is used to select the___________

a.Even bank memory

b.I/O

c.Odd bank memory

d.cache memory
30- Each wire in a bus can transfer ______________bit(s) of information.

a.one
b.two

c.many

d.three
31- A set of wires that exchanges the data between the computer components

a.FALSE

b.TRUE
32- _________________ into which the CPU will automatically load the result of a ALU
operations.

a.Accumlator Register

b.Data Register

c.Base Register

d.Code Register
33- BP register points to the top of the stack segment.

True

False
34- Assume that the value in bl 127, which of the following subtract 11 from bl register (note:
the zero bit is the right most bit)

a.None of these

b.OR BL, 11110011b

c.And BL, 11110100b

d.And BL, 11110101b


35- The 8086 fetches instruction one after another from __________ of memory

a.Stack segment

b.code segment

c.IP

d.data segment
36- What will be the segment for each of the following instruction: mov byte [bL+si+0x0100],
10; Segment is

a.The statement is not valid

b.SS

c.None of these

d.DS

e.ES

f.CS
37- Which one of the following Assembly statements can be used to invert the bits # 1, 2, 4,
6 in the CL register and the other bits are unchanged. Note that the rightmost bit is bit#
0.

a.XOR CL,01010110B

b.OR CL,10101001B

c.OR CL,01010110B

d.XOR CL,10101001B
38- When the operand of DIV instruction is of 8 bits then reminder will be stored in

a.BL

b.BH

c.CL

d.None of these

e.AH

f.AL

g.CH
39- Choose one of the assembly code that equivalent to the following while-loop structure:
While(AX < 10 ){
BX= BX + AX;
AX= AX + 2;
}

a.
loop1:CMP AX, 10
Jae outloop
Add BX,AX
Add AX,2
JMP loop1
outloop:

b.
loop1:CMP AX, 10
Jb outloop
Add BX,AX
Add AX,2
JMP loop1
outloop:

c.
loop1:CMP AX, 10

Add BX,AX
Add AX,2

Jb loop1
outlopp:

d.
CMP AX, 10
loop1: Jae outloop
Add BX,AX
Add AX,2
jmp loop1
outloop:

40- cmp AX,CX instruction modifies the

a.flag register

b.CX register

c.IP register

d.AX register
41- How many times does this loop?
L1: MOV CX, 4
DEC CX
Loop L1

a.4

b.3

c.2

d.forever (infinity loop)


42- which of the following code will set the screen cursor at row 12 and column 20

a.
mov ah,02h
mov dh,12
mov dl,20
int 21h

b.
mov ah,02h
mov dh,12
mov dl,20
int 10h

c.
mov ah,02h
mov ch,12
mov cl,20
int 10h

d.
mov ah,02h
mov ch,12
mov cl,20
int 21h

43- Choose one of the assembly code that equivalent for the following if-else construct:
IF(AX<BX)
AX=AX+2;
ELSE IF(AX>BX)
AX=AX+1;
ELSE
AX=AX-1;

a.
CMP AX, BX
JE L1
JL L2
INC AX

JMP ENDIF

L1: DEC AX
JMP ENDIF
L2: ADD AX, 2
ENDIF:

b.
CMP AX, BX
JE L1
JG L2
INC AX
JMP ENDIF
L1: DEC AX
JMP ENDIF
L2: ADD AX, 2
ENDIF:

c.
CMP AX, BX
JG L1
JL L2
INC AX
L1: DEC AX
JMP ENDIF
L2: ADD AX, 2
ENDIF:

d.
CMP AX, BX
JE L1
JG L2
INC AX
L1: DEC AX
L2: ADD AX, 2
ENDIF:

44- Choose one of high-level if-else construct that is equivalent to the following code:
Cmp AX,3
Jae next
Cmp Bx,2
Jae next
Mov CX,1
Jmp endif_st
next:
mov CX,0
Endif_st:

a.

IF (AX < 3) OR (BX < 2) THEN


CX = 1
ELSE
CX = 0
ENDIF

b.

IF (AX < 3) and (BX < 2) THEN


CX = 1
ELSE
CX = 0
ENDIF

c.

IF (AX < 3) and (BX < 2) THEN


CX = 0
ELSE
CX = 1
ENDIF

d.

IF (AX >= 3) and (BX >= 2) THEN


CX = 1
ELSE
CX = 0
ENDIF
45- What is the effect of the following instructions:
MOV AH, 02H
INT 21H

a.display the character in dl

b.display the character in al

c.read a character into al

d.read a character into dl


46- The INT 10H service 06H is used to Scroll up window, You must assign the window
coordinates as ______________________

a.None of the above

b.DH = Upper row number, DL = Left column number, CH = Lower row number, CL = Right
column number

c.CH = Upper row number, CL = Left column number, DH = Lower row number, DL = Right
column number

d.BH = Upper row number, BL = Left column number, DH = Lower row number, DL = Right
column number
47- Given the followin psudo code:
Ax =DX;
if(AX is odd)
AX= Ax+2 ;
else
AX = A+1;

Complete the blanks in the following Assembly code to be equivalent to the given (psudo
code) high-level code.

mov Ax,Dx
mov cl,2
Div cl
cmp ______,0
_____ next
add Ax,2
jmp endif
next: add ax,1
endif:

a.
AH
je
b.
AH
jne

c.
AL
je

d.
AL
jne
48- Which of the following will display a string whose address is in the dx register:

a.
mov ah, 9h
int 22h

b.None of these

c.
mov ah, 2h
int 20h

d.
mov ah, 9h
int 21h

e.
mov ah, 0h
int 21h

You might also like