Professional Documents
Culture Documents
20.02.2024
21.02.2024
22.02.2024
26.02.2024
Problem 1
Q1. Find the results and the state of the flags CF, ZF and OF after
executing the following instructions.
Given AX = 008CH, BX = 345EH, CX = 67EBH
i. AND BL,CL
ii. OR AH,BH
iii. XOR AL,CH
iv. TEST AH,BL
Q2. Find out the content of AL after executing each line of this
ALP.
MOV AL,8AH
SHL AL,1
ADC AL,0
SAL AL,1
SHR AL,1
ADD AL,80H
SAR AL,1
Q5. Find out the content of AL after executing the given ALP.
a. b.
MOV AL,14H MOV AL,39H
MOV BL,29H MOV BL,48H
ADD AL,BL
ADD AL,BL
DAA
DAA
a.
MOV AL,14H
MOV BL,29H
ADD AL,BL ;AL = 3DH
DAA ;AL = 43H, 0110b is added to the lower nibble of 3DH as D>9.
b.
MOV AL,39H
MOV BL,48H
ADD AL,BL ;AL = 81H
DAA ;AL = 87H, 0110b is added to the lower nibble as auxiliary carry
;flag AF is set during addition of lower nibbles (9H + 8H).
Q4. Find out the content of CL and Carry Flag (CL) after executing the
given ALP. b.
a. MOV AL, 08H
MOV AL, 10H MOV BL, 10H
MOV BL, 08H NEG BL
NEG BL ADD AL, BL
ADD AL, BL JC L1
JC L1 NEG AL
NEG AL
L1:
L1: MOV CL, AL
MOV CL, AL
8
L1:
MOV CL, AL ;CL = 08H , CL is the answer as CF = 1
b.
MOV AL, 10H
MOV BL, 08H
NEG BL ;BL = F0H
ADD AL, BL ;AL = F8H, CF = 0
JC L1
NEG AL ;AL = 08H
L1: 9
MOV CL, AL ;CL = 08H, negative of CL is the answer as CF = 0
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Problem 5