Saturday, 15 April 2017

Assembly Language Chapter-2

CHAPTER-2

(x86 Processor Architecture)

2.1.5 Section Review



1. The central processor unit (CPU) contains registers and what other basic elements?

A      Control Unit, Arithmetic Logic Unit, and the clock.



2-The central processor unit is connected to the rest of the computer system using what three buses?
Data Bus, Control Bus, Address Bus.


3-Why does memory access take more machine cycles than register access?

Conventional memory is outside the CPU, and it responds more slowly to access requests. Registers are hard-wired inside the CPU.

4-What are the three basic steps in the instruction execution cycle?

Fetch, Decode, Execute.


5-Which two additional steps are required in the instruction execution cycle when a memory operand is used?

Fetch memory operands, store memory operands .



Section Review 2.2.5:

1-What are the x86 processor’s three basic modes of operation?

Protected Mode.

Real-address mode.

System management mode.


2- Name all eight 32-bit general-purpose registers.

EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP


3- Name all six segment registers

CS, DS, SS, ES, FS, GS





4-What special purpose does the ECX register serve?

Extended Counter Register used for loop counting.
5-Besides the stack pointer (ESP). Which other register points to variables on the stack?
EBP
6-Name at least four CPU status flags?
Carry Flag: unsigned arithmetic out of range


Overflow Flag: signed arithmetic out of range


Sign Flag: result is negative


Zero Flag: result is zero


Auxiliary Carry Flag: carry from bit 3 to bit 4


Parity Flag: sum of 1 bits is an even number


7-Which flag is set when the result of an unsigned arithmetic operation is too large to fit into the destination?
Carry Flag


8-Which flag is set when the result of a signed arithmetic operation is either too large or too small to fit into the destination?
Overflow Flag


9-Which flag is set when an arithmetic or logical operation generates a negative result?
Sign Flag


2.4.3 Section Review1. Describe SRAM and its most common use.

SRAM stands for Static Random Access Memory, used primarily for expensive, high speed cache memory.
It does not have to be refreshed.



2. Describe VRAM.

VRAM stands for Video Random Access Memory

it holds video data,

it is dual ported

> One port allow to continusly refresh the Display

> Other port writes data to display

3. List at least two features found in the Intel P965 Express chipset.


Support for multiple USB ports, multiple PCI express slots, networking, and Intel Quiet System technology

A high definition audio chip provides digital sound capabilities



4. Name four types of RAM



  • DRAM
  • SRAM
  • VRAM
  • CMOS RAM


5. What is the purpose of the 8259A PIC controller?

The 8259A Programmable Interrupt Controller (PIC) handles external interrupts from hardware devices, such as the keyboard, system clock, and disk drives.

2.5.2 Section Review

1. Of the four levels of input/output in a computer system, which is the most universal and
portable?

Level 2 (OS) works on any computer running the same operating system. If an I/O device lacks certain capabilities, the
OS will do its best to approximate the intended result. Level 2 is not particularly fast because
each I/O call must go through several layers before it executes.

2. What characteristics distinguish BIOS-level input/output?

BIOS: The basic input–output system is a collection of low-level subroutines that communicate directly with hardware devices. The BIOS is installed by the computer’s manufacturer and
is tailored to fit the computer’s hardware. Operating systems typically communicate with
the BIOS


3. Why are device drivers necessary, given that the BIOS already has code that communicates
with the computer’s hardware?

Device drivers are programs that permit the operating system to communicate
directly with hardware devices and the system BIOS. 

device driver satisfies the request by executing code
in the device firmware that reads data in a way that is unique to the device.




2.8 Review Questions


1. In 32-bit mode, aside from the stack pointer (ESP), what other register points to variables on

the stack?

EBP Extended Base Pointer register is another register that is used to hold the variable on stack.


2. Name at least four CPU status flags.
  •  Carry
  •  Zero
  • Sign
  • Direction

3. Which flag is set when the result of an unsigned arithmetic operation is too large to fit into
the destination?
Carry Flag

4. Which flag is set when the result of a signed arithmetic operation is either too large or too
small to fit into the destination?
Over Flag

5. (True/False): When a register operand size is 32 bits and the REX prefix is used, the R8D
register is available for programs to use.


True

6. Which flag is set when an arithmetic or logical operation generates a negative result?

Sign Flag

7. Which part of the CPU performs floating-point arithmetic?

Floating Point Unit

8. On a 32-bit processor, how many bits are contained in each floating-point data register?
80 bits

9. (True/False): The x86-64 instruction set is backward-compatible with the x86 instruction set.

True

10. (True/False): In current 64-bit chip implementations, all 64 bits are used for addressing.

False

11. (True/False): The Itanium instruction set is completely different from the x86 instruction set.

True

12. (True/False): Static RAM is usually less expensive than dynamic RAM.

False

13. (True/False): The 64-bit RDI register is available when the REX prefix is used.

True

14. (True/False): In native 64-bit mode, you can use 16-bit real mode, but not the virtual-8086
mode.
False

15. (True/False): The x86-64 processors have 4 more general-purpose registers than the x86
processors.
False

16. (True/False): The 64-bit version of Microsoft Windows does not support virtual-8086 mode.

True

17. (True/False): DRAM can only be erased using ultraviolet light.

False

18. (True/False): In 64-bit mode, you can use up to eight floating-point registers.

True

19. (True/False): A bus is a plastic cable that is attached to the motherboard at both ends, but


does not sit directly on the motherboard.
False

20. (True/False): CMOS RAM is the same as static RAM, meaning that it holds its value without


any extra power or refresh cycles.
False

21. (True/False): PCI connectors are used for graphics cards and sound cards.

True

22. (True/False): The 8259A is a controller that handles external interrupts from hardware


devices.
True

23. (True/False): The acronym PCI stands for programmable component interface.

False

24. (True/False): VRAM stands for virtual random access memory.


True


25. At which level(s) can an assembly language program manipulate input/output?


Hardware, Bios and OS



26. Why do game programs often send their sound output directly to the sound card’s hardware ports.


It gives more precise control of Hardware, and execution is faster.
 

2. Others

1. What is the duration of a single clock cycle in a 3-GHz processor?


1/3GHz = 1/(3*109) = 3.3*10-10 S = 0.33 ns

2. Define pipelined execution.

Executing processor stages in parallel.


3. In a 5 -stage non-pipelined processor, how many clock cycles would it take to execute 2 instructions?

n=2 , k=5
# of cycles = k*n = 5*2 =10 cycles


4. In a 5-stage single-pipelined processor, how many clock cycles would it take to execute 8 instructions?

n=8 , k=5
# of cycles = k + (n-1) = 5 + (8-1) = 12 cycles





5. What is the range of addressable memory in protected mode?

4GB from 00000000 to FFFFFFFFh


6. What is the range of addressable memory in real-address mode?

1MB from 00000 to FFFFFh


7. In Real -address mode. Convert the following segment-offset address to a linear address: 0950:0100

09500h+0100h=09600h




Thank you for visiting us:
Daniyal Younis