عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -٣
١٤٠١٢١٤ 2nd S em ester 1 43 0/143 1 Q u iz 6 M onda y 31M a y 20 10 ـھ١٤٣١يناثلاىدامج١٧ 1
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, 9 45A3 0
RCR AX, 5 4BA3 0
- Write a single logical (AND, OR, NOT, XOR) instruction to do each of the following:
1) Complement the least three bits of AL.
2) Clear (make zero) the middle 4 bits of AL.
3) Assume AL is an unsigned odd number, decrement the number by one.
- Write a single shift (SHL, SHR, SAR, SAR) instruction to do each of the following:
1) Assume BL is a negative number with 4 zeros in its least significant bits; divide its value by 4.
2) Multiply the value in BL by 2.
3) Divide BL by 8, assuming it is a positive number of two hexadecimal digits and least significant digit is 0h.
عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -٣
١٤٠١٢١٤ 2nd S em ester 1 43 0/143 1 Q u iz 6 M onda y 31M a y 20 10 ـھ١٤٣١يناثلاىدامج١٧ 2
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
POP CX
AX BX CX SP TOS content
What is the value of CX after running the following code:
MOV CX, 0 MOV AX, 4 DEC AX DEC AX Adnan: INC CX
SUB AX, 1 JZ Go_out JMP Adnan Go_out: MOV AX, 9
---
Circle in front of statements if they are true (T) or false (F)?
1) T F Macro invocation is done at run time, however, procedure invocation is done at assembly time.
2) T F Macro is always preferred when compared to procedures, because Macro executes faster and consumes less memory space while procedures are very old unused techniques.
3) T F Input/Output devices are assigned addresses in the range of the first 64K byte in the same memory address map. In order to distinguish between the addresses used by the I/O devices and those used by the memory, I/O addresses are called ports.
4) T F Interrupts can be initiated by both software and hardware. However, procedures can be initiated only by software.
5) T F Interrupt Service Routines are loaded by the application programs different than procedures which are memory resident and normally cannot be changed.
6) T F Interrupts are identified by names while procedures are identified by numbers.