Comorg TP Dacula

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

JOHN ART DACULA

BSCPE701

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 = 1782h BX


MOV BX, 1278h = 1278h DX =
ADD AX, BX 29FAh
RET

2. MOV AX, 1782h AX = 1782h BX


MOV BX, 1278h = 1278h DX =
SUB AX, BX 50Ah
RET

3. MOV AL, 82h AX = 82h BX


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

4. MOV AX, 57F2h AX = 57F2 BX


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

5. MOV AX, 1782h AX = 1782


MOV BX, 1278h BX = 1278
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 What would be the value of AX after program execution?
MOV BX, 1251h AX = (0000000001000001)2 = (65)10 = (41h)
AND AX, BX
RET

2. MOV AX, 614Bh What would be the value of AX after program execution?
MOV BX, 1251h AX = (0111001101011011)2 = (29531)10 = (735Bh)
OR AX, BX
RET

3. MOV AX, 614Bh What would be the value of BX after program execution?

This study source was downloaded by 100000814011065 from CourseHero.com on 02-10-2022 18:17:09 GMT -06:00

https://www.coursehero.com/file/118595300/COMORG-TP-DACULAdocx/
MOV BX, 1251h AX = (0111001100011010)2 = (29466)10 =
(731Ah) XOR BX, AX
RET

4. MOV DX, 614Bh What would be the value of DX after program execution?
NOT DX AX = (1001111010110100)2 = (40628)10 =
(9EB4h) RET

5. MOV AX, 614Bh What would be the value of AX after program execution?
MOV BX, 1251h AX = (1110110111101111)2 = (60911)10 =
(EDEFh) 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
SHR AL, 1 execution? AL = 0000
SHL AL, 3
RET

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

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

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

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

This study source was downloaded by 100000814011065 from CourseHero.com on 02-10-2022 18:17:09 GMT -06:00

https://www.coursehero.com/file/118595300/COMORG-TP-DACULAdocx/
Powered by TCPDF (www.tcpdf.org)

You might also like