Asm Compiled Quizzes v30 1 PDF Free

You might also like

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

QUIZ 1

Question Answer
1. CLC 1 or 0
STI
CMOVC BL,AL
BL=[1]
2. MOV AL, ‘3’ 0
SUB AL, 32h
CMOVE CL, ‘R’
CL=[1]
3. 0201

4.

5.

6. 1. UP
2. NZ
3. NC
4. EI
5. NA
6. NV
7. PL
8. PO

(tama lahat to)


7. xor ah, ah
mov al, 30
mov bl, 5
div bl
mov value, al
mov bh, 4

sbb bh, 0

mov bh, 3

mov ah, [di]


mov [di], al

8. What is the value of BH after the following?


SUB BH,BH
STC
RCR BH,1
STC
RCR BH,1
BH=
9. If a conditional jump is not taken, the instruction in the specific label will
be executed.
10. Base Relative Plus Index

11. Based Index or Register Relative

REGISTER INDIRECT ADDRESSING


Sabi dito:
http://www.ic.unicamp.br/~celio/mc404s2-
03/addr_modes/intel_addr.html

12. CL

13. Something (tama to)

14. XCHG AX, CX


15. MOV AL, 0FEh CB or 1 or CD
MOV BL, 0CDh
ADD AL, BL
CMOVNO AL, CL
AL=[1]
16. What is the equivalent arithmetic operation of add ah, 12 or SAL
MOV AH,4
SHL AH,2

QUIZ 2
Question Answer
1. Use operands 4FCAH and C237H to perform AND 4202 (wala daw H ata, king ina)
2. SUB CX, BX
SUB DH, OEEH
SUB SI, DI
SUB EBP, 3322H
SUB CH, [SI]
SUB DX, [SI+10]
SUB FROG, AL

(tama to lahat)

3. Use operands 4FCAH and C237H to perform XOR 8DFD (wala daw H ata, king ina)
4. ANDing a word operand with FFFH will result in what value for the word 000 (tama to)
operand? To set all bits of an operand to 0, it should be ANDed with
5. DAA – BCD Addition
DAS – BCD Subtraction
AAS – ASCII Subtraction
AAA – ASCII Addition

(tama lahat)

6. C++ to Assembly:
CMP BX, CX
JLE LABEL1
CMP DX, AX
JE COND1
JMP COND2

LABEL1: CMP BX, DX


JNE COND1
JMP COND 2

COND1: MOV X, 1
JMP EXIT

COND2: MOV X, 2
JMP EXIT
7.

8. If control is transferred outside the current code segment, is it NEAR or FAR (tama to)
FAR?
9. The CMP instruction works by performing a (n) ______ operation on the subtraction (tama to)
operands and setting the flags accordingly.
10. Use operands 4FCAH and C237H to perform OR CFFF (wala daw H ata, king ina)
11. What are the values of DX and CF after the following? DX = D11F or DX = D1 1F (not sure)
MOV DX, 3FA2H CF = 0107 or CF = 00 07 (not sure)
MOV CL, 7
ROL DX, CL
DX = ______, CF = _________
12. Which instruction aside from DIV will divide a given value Shr (tama to)
13. Give the packed BCD and unpacked BCD for decimal 15 Packed BCD – 0001 0101 (tama to)
Unpacked BCD – 0000 0001 0000 0101
(tama to)
14. If CF=1, AL=95, and BL=4F prior to the execution of “SBB AL, BL”, 16 (tama to)
what will be the contents of AL after subtraction in base 10?
15. SHORT, NEAR, FAR (tama to)

16. AL, AH (tama to parehas)

17. In unsigned multiplication of AX with BX, the product will be bplaced in AX and BX (tama to)
register(s)
18. The instruction “LOOP ADD_LOOP” is equivalent to what two DEC CX & JNZ ADD_LOOP (sagot sa
instructions? https://www.studyblue.com/#flashcard/vie
w/4126329)
19. The ADD instruction that has the syntax “ADD destination, source” Destination (tama to)
replaces the ____ operand with the sum of two operands.
20. What is the value of BX after the following FFE1H (sagot ko pero mali ako sa exam)
MOV BX, 0FFFH
MOV CL, 5
CLC
RCL BX, CL
BX = [1]

21. Which instruction will implement LOOP aside from std repne label (sagot ko pero mali ako sa
DEC DX exam)
JNZ label
JNE label (sagot ni GINO at not sure)

22. ADD data_1, data_2 is illegal because of no of operands. True or False True (not sure pero sabi ni GINO)
answer
23. To set all bits of an operand to 1, it could be ORed with 0 (tama to)
24. The ADC instruction that has the syntax "ADC destination, source" destination, source + destination + CF
replaces the ____ operand wiith the sum of ___ (sagot sa
https://www.studyblue.com/#flashcard/vie
w/4126329) (sagot ko pero mali ako sa
exam)
25. In unsigned division of a doubleword in DX AX by a word in CX, the [1] AX
quotient will be placed in and the remainder in [2] DX

(tama parehas)
26. Which instruction will convert packed BCD to unpacked BCD rcr (not sure)
27. Write the instruction and the answer based on CPU process (2's) on 0011 1110 (tama to)
subtracting 05H from 43H in binary with format XXXX XXXX
28. In calculating the target address to jump to, a displacement is added to the PC (tama to)
contents of the register _____
29. Given the following False (tama to)
MOV BX, 04Fh
ADD BX, 0B1h
The execution results in ZF=1
30. Which instruction aside form MUL will multiply a given value? IMUL (galing to sa kabilang gc, not sure
kung tama)
31. The CMP instruction alters the contents of its operands False (galing to sa kabilang gc, not sure
kung tama)
32. Develop a short sequence of instructions that adds AX,BX,CX,DX and
SP and save the sum in Dl
33. What is the value of BL and CF after the following BL = 52, CF = 1
MOV BL, 25H
MOV CL, 4 (tama to parehas)
ROR BL, CL
BL=[1], CF=[2]
34. 1. True
2. False
3. 9
4. mov ax, A
5. True

(6 tama ko, di ko lam ano ung tama)

35. .model small

?.data

msg1 db "Enter a string: $"


msg2 db "Enter a character to check: $"
msg3 db "There are $"
bufferSize db 51
inputLength db 0

userInput db 51 dup (0)


characterCount db ?
characterCheck db ?
.code

mov ax, @data


mov ds, ax
mov es, ax

mov ah, 09h


lea dx, msg1
int 21h

mov ah, 09h

lea dx, msg2


int 21h

mov ah, 01h


int 21h

lea di, userInput


mov cx, [inputLength]
cld

loop1:

repne scasb
je increment
jmp output
increment:

inc characterCount
jmp loop1

output:

mov ah, 09h


lea dx, msg3
int 21h
mov ah, 02h
mov dl, al
int 21h
mov ah, 4ch
int 21h

QUIZ 3
Question Answer
1. When the computer is booted in MS-DOS, the default mode is 3. False (sagot ko pero mali ako dito)
2. Bits 4 to 7 for the Background sets the colors in the video attribute byte. False (Tama to)
3. Red, Green, Blue electron beams are required to generate any color on a True (sagot ko pero mali ako dito)
video display
4. INT10h function 2h sets the cursor position on the screen. >True rin sagot ko pero mali ako eh.
TRUE DAPAT YAN EH KUPAL
TALAGA NI MA’AM

> bale False sagot


5. The row and column values can be loaded in register BX False (tama to)
6. The DOS interrupt and service function used for keyboard input without False (tama to)
echo is INT 21h and 07H respectively.
7. Each position on the video display hold ASCII code for a single character. True (sagot ko pero mali ako dito)
8. For monochrome monitors "00000111" would give the normal screen I fuckin don’t know the answer
mode where background is white and the foreground is black.
9. INT 10h service function 09h in AL writes a character and attribute at the True (sagot ko pero mali ako dito)
current position.
10. INT 10h and AH=00h gets the current video mode False (tama to)
11. File
attributes
“myfile.txt”
File handle

(sagot ko pero mali lahat)

(Eto ung sagot)

12. CX
True
CF=1
INT 21h

(3 out 4 ung tama ko dito)

13. False
MOV AH, 3CH
MOV CL, 1
LEA DX, FNAME

(Tama to lahat)

14. INT 10h service function 7h scrolls a rectangular window downward True (tama to)
15. Code a macro that will take as parameter the special functions( Function Key macro pressedKey, message
keys, ctrl, alt, tab,etc) and the string associated to the key pressed. loop1:
Example if a CTRL key is pressed, user will be prompted with " You just cmp pressedKey, 1ch
pressed and CTRL key" je enterPressed
cmp pressedKey, 47h
je homePressed
cmp pressedKey, 4fh
je endPressed
cmp pressedKey, 49h
je pgUpPressed
cmp pressedKey, 53h
je delPressed
jmp loop1
enterPressed:
mov ah, 09h
lea dx, message
int 21h
jmp exit
homePressed:
mov ah, 09h
lea dx, message
int 21h
jmp exit
endPressed:
mov ah, 09h
lea dx, message
int 21h
jmp exit
pgUpPressed:
mov ah, 09h
lea dx, message
int 21h
jmp exit
delPressed:
mov ah, 09h
lea dx, message
int 21h
exit:
mov ah, 4ch
int 21h
endm
16.

FINAL EXAMINATION (LAST TERM)


Question Answer
1. Which of the following is/are an invalid addressing?
2. Which of the following is/are an Immediate addressing?
3. It is an addressing that allows data to be addressed at the memory location BASE INDEXED ADDRESSING
pointed by other a base or index register -ata
4. What is the equivalent of the following: MOV AL, 5
MOV AL, 5 SHL AL, 1
MOV CL, 2
MUL CL (tama parehas)
5. Given the following, what is the content of the destination after executing 06Eh (tama to)
the instruction
CLD
MOV AL,10111001b
ROR AL, 2
6. The time is&now (tama to)
7. Given the following, what is the content of the destination after executing DFh (tama to)
the instruction:
CLD
MOV AL, 09Fh
BTS AL, 6
8. Given the following, what is the content of the destination after executing 47 (not sure)
the instruction
CLD
MOV AL,10111001b
NEG AL
9. Given the following what is the content of the register after executing the AX=000Ch (tama to)
instruction
MOV AX, 11001100b
XOR AX, 0CH
10. Given the following, what is the content of the of the CF register after 00000001 (tama to)
executing the instruction. Assuming all the status are cleared.
CLC
MOV AL, 09Fh
RCR, 3
11. Given the following , what is the content of the destination after executing NONE OF THE ABOVE (tama to)
the instructions
MOV AX, 0FEEDh
AND AX, 0FOODh
12. In unsigned multiplication of AX with BX, the product will be bplaced in AX and BX (tama to)
register(s)
13. The ADC instruction that has the syntax "ADC destination, source" destination, source + destination + CF
replaces the ______ operand wiith the sum of _____. (sagot sa
https://www.studyblue.com/#flashcard/vie
w/4126329) (sagot ko pero mali ako sa
exam)
14. In unsigned division of a doubleword in DX AX by a word in CX, the [1] AX
quotient will be placed in [1] and the remainder in [2] [2] DX

(tama parehas)
15. In unsigned division of a word in AX by a word in DATA1, the quotient
will be placed in [1] and the remainder in [2]
16. GIven: MOV BL,04Fh False (galing to sa kabilang gc, not sure
ADD BL, 0B1H kung tama)
The execution part results in ZF=0. True or False
17. In unsigned multiplication of a byte in DATA1 with a byte in AL, the AX (tama to)
product will be placed in register(s)
18. Give the packed BCD [1] and packed BCD [2] for decimal 15 Packed BCD – 0001 0101 (tama to)
Unpacked BCD – 0000 0001 0000 0101
(tama to)
19. In unsigned multiplication of CX with a byte in AL, the product is placed
in both AX and DX registers.
20. Select a SUB instruction that will SUB CX, BX
SUB DH, OEEH
Question SUB SI, DI
Subtract BX from CX SUB EBP, 3322H
subtract 0EEH from DH SUB CH, [SI]
Subtract DI from SI SUB DX, [SI+10]
Subtract 3322H from EBP SUB FROG, AL
Subtract the data addressed by SI from CH
Subtract the data stored 10 words after the location addressed by SI from (tama to lahat)
DX
Subtract AL from memory location FROG
21. The ADD instruction that has the syntax "ADD destination, source" Destination (tama to)
replaces the __________ operand with the sum of the two operands
22. Rewrite the instruction ADD Data1, Data2 to make it a valid instruction.
Assuming it is of a byte size
23. Give the packed BCD [1] and packed BCD [2] for decimal 99 Packed BCD – 1001 1001 (tama to)
Unpacked BCD – 0000 1001 0000 1001
(tama to)
24. IF CF=1, AL=95, and BL=4F prior to the execution of "SBB AL, BL", 16 (tama to)
what will be the contents of AL after subtraction in base 10?
25. A (n) [1] jump is within -128 to 127 bytes of the current IP. A (n) [2] [1] SHORT
jump is within the current code segment, whereas a (n) [3] jump is outside [2] LONG
the current code segment. [3] FAR

(tama lahat)
26. Given the following False (tama to)
MOV BX, 04Fh
ADD BX,0B1h
The execution results in ZF=1.
27. If a conditional jump is not taken, the instruction in the specified label True or false ata to pero sagot nila amir
will be executed. dito is
false
28. Match the following instruction mnemonic with its function DAA – BCD Addition
DAS – BCD Subtraction
Question AAS – ASCII Subtraction
DAA AAA – ASCII Addition
DAS
AAS (tama lahat)
AAA
29. In unsigned division of a word in AX by a byte in DATA2, the quotient
will be placed in [1] and the remainder [2]
30. ANDing a word operand with FFFH will result in what value for the word 000 (tama to)
operand? To set all bits of an operand to 0, it should be ANDed with
31. To get the current cursor position, interrupt [1] and function [2] is used. [1] 10H
[2] 03H

(tama parehas)
32. For monochrome monitors "00000111" would give the normal screen [1] black
mode where background is [1] and the foreground is [2] and [3] [2] blinking
[3] light gray

(tama lahat)
33. The most significant bit of the CGA attribute byte refers to [1] and bit 03 [1] bit position
is for [2] [2]selects front

(tama parehas)
34. INT ___ function calls reside in ROM BIOS, whereas INT ___ function [1] 10H
calls provided by OS [2] 21H

(tama parehas)
35. What is wrong with the following ASCIIZ string?
PATH_NAME DB 'C:\PROGRAMS\TEST.DAT'
36. The clear screen function uses interrupt [1] and function [2]
37. The following code is an attempt to call INT 33H function 2. Is it correct? MOV AX, 2
[1] If not, correct only the instruction that makes it wrong.
MOV AH,2 (not sure)
INT 33H
38. if IRGB = 0000 [1] , IRGB = [2] RED IRGB = 1110 [3] [1] Black
[2] FF00
[3] Gray

(not sure)
39. The row and column values can be loaded in Register [1] when interrupt [1] DX
[2] is used [2]10H

(not sure)
40. The file is [1] when function 3CH is used to create a file and file already
exists.
41. INT 33H function AX=3, how can a left button press be detected?
42. What is wrong with the following file handle? FILE_HNDL DW (not sure)
FILE_HNDL DB ?
43. True or False. FCB and file handles can be used interchangeably with the TRUE (not sure)
same DOS 21H function calls?
44. Given the following, what is the content of the destination after executing 0A7h (tama to)
the instruction
CLD
MOV AL, 09Fh
RCL AL, 7
45. What is the equivalent instruction of the following CLD
.data MOV CL, 16
N db “The time is gold” LEA SI, N
.code MOV AL, ‘O’
main: REPE SCASB
mov ax, @data
MOV DS, Ax (tama to lahat)
MOV ES, AX
X: MOV CL, 0Fh
LEA SI, N
MOV AL, ‘O’
CMP AL, byteptr[SI]
JE X
end main
46. What is the equivalent instruction of JNA JBE (tama to)
47. Which of the following is the equivalent instruction of X:
X: MOV CX, 3 XOR CH, CH
INC SI MOV CL, 3
LOOP INC SI
DEC CX
JNZ X

(tama to)
48. Which of the following is the equivalent instruction of MOV AX, 0FH
MOV AX, 0Fh MOV BX, AX
MOV BX, AX CMP AX, BX
CMP AX, BX JNLE Z
JB Z
(tama to)
49. What is the complement instruction of JO? JNO (tama to)
50. Given the following, what is the content of the registers after executing AX=0CCFFh
the instructions BX=00FFh
MOV AH, 11001100b
MOV AL, 00110011b (tama to)
OR AX, BX
51. Given the following code, what is the content of AL after executing the 01110011 (tama to)
instruction?
CLC
MOV AL, 100110110b
ROL AL, 5
52. The following are string instructions that use the accumulator except CMPS (tama to)
53. JG is equivalent to JNLE (tama to)
54. What sis the equivalent jump instruction of JNP JPO (tama to)
55. Which of the following is the equivalent of the given instruction MOV AL, 080H
MOV AL, 128 SHR AL, 1
MOV DL, 2
DIV DL (tama parehas)
56. HHHHHHHHHHHH (tama to)

57. xof nword kmiuq ehT

(tama to)

58. Given the following code, what is the value of CX when the scan &
compare produces its first match?

59. Which function of INT 33H is used to detect the presence of a mouse in a [1] 0
PC? [1] [2] AX
In which register do we expect to get that information? [2] [3] BX
In which register do we find the number of buttons in the mouse? [3]
(tama lahat)
60. INT 33H function AX=3, how can a left button press be detected?
61. True or False. The mouse coordinate is the same as video mode
62. When program terminates before closing the output files, the data from
[1] will be lost
63. Give the addressing mode of source: MOV BX, 5678H Immediate (not sure)

A. Indirect
B. Base Relative Plus Index
C. Register
D. Register Relative
E. Base Plus Index
F. Immediate
G.Direct
Given the following, what is the content of the destination after executing AL = 33h (not sure)
the instruction:
.data
n1 db 10,20,30,40,50
n2 db '875432'
.code
lea bx,n1
mov si,4
mov al, [bx+3]
xchg al, n2[si]

no answer
al = 0B7h
AL = 33h
Given the following, what is the content of the destination after executing 0FFh (0BFh talaga tama)
the instruction:
.data
n1 db 10,20,30,40,50
n2 db '875432'
.code
lea bx,n1
mov si,4
mov al, [bx+3]
not al

no answer
0B0h
0FFh
0B7h
Give the addressing mode of destination: MOV [BP][SI]+12, AX Base Relative Plus Index (not sure)

A. Direct
B. Base Relative Plus Index
C. Base Plus Index
D. Register
E. Register Relative
F. Immediate
G. Indirect
Give the addressing mode of destination: MOV [BP+6], AL

A. Direct
B. Base Relative Plus Index
C. Base Plus Index
D. Register
E. Register Relative
F. Immediate
G. Indirect
Give the addressing mode of source: MOV BL,[SI]+10 Register Relative (not sure)

A. Direct
B. Base Relative Plus Index
C. Base Plus Index
D. Register
E. Register Relative
F. Immediate
G. Indirect
Give the addressing mode of source: MOV AH,[BX+SI+50] Base Relative Plus Index (not sure)

A. Direct
B. Base Relative Plus Index
C. Base Plus Index
D. Register
E. Register Relative
F. Immediate
G. Indirect

You might also like