Professional Documents
Culture Documents
TS5. Registers-OSCA
TS5. Registers-OSCA
Page 1 of 4
OSCA-05 Register
SECTION A
Exercises
1. What is a Register?
Small, permanent storage locations within the CPU used for a particular
purpose.
Manipulated directly by the Control Unit.
Wired for specific function.
Size in bits or bytes (not MB like memory).
Can hold data, an address or an instruction.
7. Describe functions of General Purpose Register (GPR) in the Intel architecture. You
are required to provide function of each register.
Accumulator (AX): is a preferred register to use in arithmetic, logic and data
transfer instructions.
Base register (BX): serves as an address register.
Count register (CX): Program loop constructions are facilitated by the use of
CX, which serves as a loop counter.
Data register (DX): is used in multiplication and division. It is also used in
I/O operations
8. Describe the function of registers in the set of User Invisible Registers (UIR).
Memory Address register (MAR): Holds address of memory location and
connected to address bus.
Memory Data register (MDR): Holds data being transferred to/from memory
- connected to data bus
Instruction register (IR): The fetched instruction is loaded into the IR
Program Counter (PC): The PC is updated by the CPU after each instruction
fetch
Program Status Word (PSW):
a) contain individual bit fields indicating status information from
program execution, often error conditions
b) shows status of CPU and currently executing program
10. In the following 8-bit addition, what are the states of the Carry Flag (CF), Sign Flag
(SF), Zero Flag (ZF) and Overflow Flag (VF) after the arithmetic operation has been
carried out. In the case of each flag describe what are condition(s) required for each of
the flags to be set.
11001100 + 01101011
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
S 0 1 P 0 1 Z HC 1 1 0 C 1 0 V 0
Solution
Decimal Binary
24 00011000
18 00010010
1110 1000
+ 1110 1110
1 11010110
00101001
+ 1
00101010 = 42
Sign Flag
This Flag is set (assigned a value of 1) if the result of the arithmetic operation is
negative.
Zero Flag
This Flag is set (assigned a value of 1) if the result of the arithmetic operation is
zero.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
S 0 1 P 0 1 Z HC 1 1 0 C 1 0 V 0
0 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0
3 4 C 8