عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -٣
١٤٠١٢١٤ 2nd S em ester 1 43 0/143 1 Q u iz 5 M onda y 24M a y 20 10 ـھ١٤٣١يناثلاىدامج١٠ 1
Name: ID:
Name: ID:
Fill the table below with the Hexadecimal values of AX and carry Flag (CF) after execution:
Instruction
Before execution After Execution
AX CF AX CF
ROL AX, 1 45A3 0
RCL AX, 1 4BA3 0
ROR AX, 1 45CC 0
MOV CL,3 ROR AX, CL
45A3 1
RCR AX, 1 1A3F 0
- Write a single logical (AND, OR, NOT, XOR) instruction to do each of the following:
1) Complement the middle four bits of AL.
2) Clear (make zero) the most significant bit and least significant bit of AL.
3) Convert capital letters in AL to small letters, recall that the ASCII code of ‘A’=41h and ‘a’ = 61h.
4) Assume AL is an unsigned even number, increment the number by one.
عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -٣
١٤٠١٢١٤ 2nd S em ester 1 43 0/143 1 Q u iz 5 M onda y 24M a y 20 10 ـھ١٤٣١يناثلاىدامج١٠ 2
- Write a single shift (SHL, SHR, SAR, SAR) instruction to do each of the following:
1) Assume BL is a negative even number, give half its value.
2) Double the value in BX.
3) Divide BL by 8, assuming it is a positive number of two hexadecimal digits and least significant digit is 0h.
4) Check if AX contains an even number through carry flag, if AX is even number make carry flag = 0.
Suppose that AX = 1234h, BX = 5678h, CX = 9ABCh and SP = 0100h. Give the Hexadecimal contents of AX, BX, CX, SP and TOS (the word on top of the stack) after executing each of the following instructions:
PUSH AX
AX BX CX SP TOS content
PUSH BX
AX BX CX SP TOS content
POP AX
AX BX CX SP TOS content
PUSH CX
AX BX CX SP TOS content
POP BX
AX BX CX SP TOS content
POP CX
AX BX CX SP TOS content