You are on page 1of 2

IT2104

Task Performance
Arithmetic and Logic Instructions
Objective(s):

At the end of the exercise, the students should be able to:

 Differentiate the function of each logic and arithmetic instruction.

Part A: Arithmetic Instructions


Determine the resulting values of AX, BX, and DX for each set of assembly codes. Answer in hexadecimal
format. (15 items x 2 points)
1. MOV AX, 1782h AX = _____________
MOV BX, 1278h BX = _____________
ADD AX, BX
DX = _____________
RET

2. MOV AX, 1782h AX = _____________


MOV BX, 1278h BX = _____________
SUB AX, BX
DX = _____________
RET

3. MOV AL, 82h AX = _____________


MOV BL, 81h BX = _____________
MUL BX
DX = _____________
RET

4. MOV AX, 57F2h AX = _____________


MOV BX, 1375h BX = _____________
DIV BX
DX = _____________
RET

5. MOV AX, 1782h AX = _____________


MOV BX, 1278h BX = _____________
MOV DH, 55h
DX = _____________
ADD AX, BX
MOV BX, 0278h
SUB AX, BX
RET

Part B: Logic Instructions


Answer the question for each set of assembly codes. Answer in hexadecimal format. (5 items x 2 points)
1. MOV AX, 614Bh What would be the value of AX after program execution? ___________
MOV BX, 1251h
AND AX, BX
RET

2. MOV AX, 614Bh What would be the value of AX after program execution? ___________
MOV BX, 1251h

04 Task Performance 1 *Property of STI


Page 1 of 2
IT2104

OR AX, BX
RET

3. MOV AX, 614Bh What would be the value of BX after program execution? ___________
MOV BX, 1251h
XOR BX, AX
RET

4. MOV DX, 614Bh What would be the value of DX after program execution? ___________
NOT DX
RET

5. MOV AX, 614Bh What would be the value of AX after program execution? ___________
MOV BX, 1251h
AND AX, BX
NOT BX
XOR AX, BX
RET

Part C: Rotate and Shift Instructions


Answer the question for each set of assembly codes. (5 items x 2 points)
1. MOV AX, 6Bh What would be the value of AL, in binary form, after program execution?
SHR AL, 1 ___________
SHL AL, 3
RET

2. MOV AX, AAAAh In hexadecimal format, what would be the value of AX after program
MOV CL, 8 execution? ___________
SHL AX, CL
RET

3. MOV AL, 8Ch What would be the value of AL, in binary form, after program execution?
MOV CL, 3 ___________
SAR AL, CL
RET

4. MOV AL, 6Bh In hexadecimal format, what would be the value of AL after program
ROR AL, 1 execution? ___________
ROL AL, 3
RET

5. MOV AX, 6Bh What would be the value of AL, in binary form, after program execution?
RCR AL 3 ___________
RET

04 Task Performance 1 *Property of STI


Page 2 of 2

You might also like