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

Arithmetic and Logic Instructions: Task Performance

The document contains instructions for arithmetic, logic, rotate, and shift assembly language operations. It provides sample code segments and asks students to determine the resulting values of registers like AX, BX, and DX after each operation. The objective is for students to differentiate the functions of various logic and arithmetic instructions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views

Arithmetic and Logic Instructions: Task Performance

The document contains instructions for arithmetic, logic, rotate, and shift assembly language operations. It provides sample code segments and asks students to determine the resulting values of registers like AX, BX, and DX after each operation. The objective is for students to differentiate the functions of various logic and arithmetic instructions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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 = 29FAh
MOV BX, 1278h BX = 1278h
ADD AX, BX
DX = 0
RET

2. MOV AX, 1782h AX = 50Ah


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

3. MOV AL, 82h AX = 4182h


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

4. MOV AX, 57F2h AX = A1Eh


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

5. MOV AX, 1782h AX = 2782h


MOV BX, 1278h BX = 0278h
MOV DH, 55h
DX = 0
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
04 Task Performance 1 *Property of STI
Page 1 of 2
IT2104

MOV BX, 1251h What would be the value of AX after program execution? _ 0041h _
AND AX, BX
RET

What would be the value of AX after program execution? _ 735Bh


2. MOV AX, 614Bh

MOV BX, 1251h


OR AX, BX
RET

3. MOV AX, 614Bh What would be the value of BX after program execution? _ 7318h _
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? _ EDEFh _
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 10101000 _
SHL AL, 3
RET

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

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

04 Task Performance 1 *Property of STI


Page 2 of 2
IT2104

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

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

04 Task Performance 1 *Property of STI


Page 3 of 2

You might also like