0% found this document useful (0 votes)
80 views

04 Task Performance 1 - Arithmetic and Logic Instructions

The document provides instructions and questions to test understanding of arithmetic, logic, rotate and shift assembly language instructions. It contains examples of code segments and questions about the resulting values of registers like AX, BX and DX after executing the instructions.

Uploaded by

Nice Move
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

04 Task Performance 1 - Arithmetic and Logic Instructions

The document provides instructions and questions to test understanding of arithmetic, logic, rotate and shift assembly language instructions. It contains examples of code segments and questions about the resulting values of registers like AX, BX and DX after executing the instructions.

Uploaded by

Nice Move
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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 = 2AFAh
MOV BX, 1278h BX = 1278h
ADD AX, BX
DX = none
RET

2. MOV AX, 1782h AX = 50Ah


MOV BX, 1278h BX = 278h
SUB AX, BX
DX = none
RET

3. MOV AL, 82h AX = 6782h


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

4. MOV AX, 57F2h AX = 0040h


MOV BX, 1375h BX = 1375h
DIV BX
RET DX = 00E7h

5. MOV AX, 1782h AX = 2AFAh


MOV BX, 1278h BX = 0278h
MOV DH, 55h
DX = 0055h
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? _ 0041h _
MOV BX, 1251h
AND AX, BX
RET

2. MOV AX, 614Bh What would be the value of AX after program execution? _ 719Bh _
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? _ 731Ah _
MOV BX, 1251h
XOR BX, AX
RET

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

5. MOV AX, 614Bh What would be the value of AX after program execution? _ 9D5Ah _
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 0101b _
SHL AL, 3
RET

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

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

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

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

04 Task Performance 1 *Property of STI


Page 2 of 2

You might also like