1. What are the special functoin register?
The special function register are stack pointer, index pointer (DPL and DPH), I/O port addresses, status(PSW) and accumulator.
2. What are the uses of accumulator register?
The accumulator registers (A and B at addresses OEOh and OFOh, respectively) are used to store temporary values and the results of arithmetic operations.
3. What is PSW?
Program status word (PSW) is the set of flags that contains the status information and is considered as one of the special function register.
4. What is stack pointer (sp)?
Stack pointer (SP) is a 8 bit wide register and is incremented before the data is stored into the stack using PUSH or CALL instructions.
It contains 8-bit stack top address. It is defined anywhere in the on-chip 128-byte RAM. After reset, the SP register is initialized to 07.
After each write to stack operation, the 8-bit contents of the operand are stored onto the stack, after incrementing the SP register by one.
It is not a top-down data structure. It is allotted an address in the special function register bank.
5. What is data pointer (DTPR)?
It is a 16-bit register that contains a higher byte (DPH) and lower byte (DPL) of a 16-bit external data RAM address.
It is accessed as a 16-bit register or two 8-bit registers. It has been allotted two addresses in the special function register bank, for its two bytes DPH and DPL.
6. Why oscillator circuit is used?
Oscillator circuit is used to generate the basic timing clock signal for the operation of the circuit using crystal oscillator.
7. What is the purpose of using instruction register?
Instruction register is used for the purpose of decoding the opcode of an instruction to be executed and gives information to the timing and control unit generating necessary signals for the execution of the instruction.
8. Give the purpose of ale/prog signal.
ALE/PROG is an address latch enable output pulse and indicates that valid address bits available on the respective pins.
The ALE pulses are emitted at a rate of one-sixth of the oscillator frequency. The signal is valid only for external memory accesses.
It may be used for external timing or clockwise purpose. One ALE pulse is skipped during each access to external data memory.
9. Explain the two power saving mode of operation. The two power saving modes of operation are:
I. Idle mode:
In this mode, the oscillator continues to run and the interrupt, serial port and timer blocks are active, but the clock to the CPU is disabled. The CPU status is preserved. This mode can be terminated with a hardware interrupt or hardware reset signal. After this, the CPU resumes program execution from where it left off.
II. Power down mode:
In this mode, the on-chip oscillator is stopped. All the functions of the controller are held maintaining the contents of RAM. The only way to terminate this mode is hardware reset. The reset redefines all the SFRs but the RAM contents are left unchanged.
10. Differentiate between program memory and data memory. i. In stores the programs to be executed.
ii. It stores only program code which is to be executed and thus it need not be written, so it is implemented using EPROM It stores the data, line intermediate results, variables and constants required for the execution of the program.
The data memory may be read from or written to and thus it is implemented using RAM.
11. What are addressing modes?
The various ways of accessing data are called addressing modes.
12. Give the addressing modes of 8051?
There are six addressing modes in 8051.They are
Direct addressing Indirect addressing Register instruction
Registerspecific (register implicit)
Immediate mode Indexed addressing
13. What is direct addressing mode?
The operands are specified using the 8-bit address field, in the instruction format. Only internal data Ram and SFRS can be directly addressed. This is known as direct addressing mode.
Eg: Mov R0, 89H
14. What is indirect addressing mode?
In this mode, the 8-bit address of an operand is stored in a register and the register, instead of the 8-bit address, is specified in the instruction. The registers R0 and R1 of the selected bank of registers or stack
pointer can be used as address registers for storing the 8-bit addresses.
The address register for 16-bit addresses can only be „data pointer‟ (DPTR). Eg: ADD A, @ R0.
15. What is meant by register instructions addressing mode?
The operations are stored in the registers R0 – R7 of the selected register bank. One of these eight registers (R0 – R7) is specified in the instruction using the 3-bit register specification field of the opcode format. A register bank can be selected using the two bank select bits of the PSN. This is called as register instruction addressing mode
Eg: ADD A, R7.
16. What is immediate addressing mode?
An immediate data ie., a constant is specified in the instruction, after the opcode byte.
Eg: MOV A, #100
The immediate data 100 (decimal) is added to the contents of the accumulator. For specifying a hex number, it should be followed by H. These are known as immediate addressing mode.
17. What is indexed addressing?
This addressing mode is used only to access the program memory. It is accomplished in 8051 for look-up table manipulations. Program counter or data pointer are the allowed 16-bit address storage registers, in this mode of addressing. These 16-bit registers point to the base of the look-up table and the ACC register contains a code to be converted using the look-up table. The look-up table data address is found out by adding the contents of register ACC with that of the program counter or data pointer.
In case of jump instruction, the contents of accumulator are added with one of the specified 16-bit registers to form the jump destination address.
Eg: MOV C, A @ A + DPTP JMP @ A + DPTR
18. List the five addressing modes of 8051 microcontroller.
The five addressing modes are, I. Immediate addressing
II. Register addressing III. Direct addressing
IV. Register indirect addressing a. Indexed addressing.
19. MOV R4, R7 is invalid. Why?
The movement of data between the accumulator and Rn (for n = 0 to 7) is valid. But movement of data between Rn register is not allowed. That is why MOV R4, R7 is invalid.
20. WHAT IS SFR?
In the 8051 microcontroller registers A, B, PSW and DPTR are part of the group of registers commonly referred to as special function registers (SFR).
21. WHAT ARE THE TWO MAIN FEATURES OF SFR ADDRESSES?
The following two points should be noted SFR addresses. The special function registers have addresses between 80H and FFH. These addresses are above 80H, since the addresses 00 to 7FH are addresses of RAM memory inside the 8051.
II. Not all the address space of 80 to FH is used by the SFR. The unused locations 80Hto FFH are reserved and must not used by the 8051 programmer.
22. What is the difference between direct and register indirect addressing mode?
Loop is most efficient and is possible only in register indirect addressing whereas looping is not direct addressing mode.
23 List out some compare instructions. The compare instructions are:
24 Write a program to save the accumulator in r7 of bank 2. CLR PSW – 3
SETB PSW – 4 MOV R7, A.
25. What are single bit instructions? Give example.
Instructions that are used for single bit operation are called single bit instructions. Examples: SETB bit
CLR bit CPL bit
26. Write a program to save the status of bits p1.2 and p1.3 on ram bit LOCATIONS 6 AND 7
MOV C, P1.2; save status of P1.2 on CY
MOV O6, C; save carry in RAM bit location 06 MOV C, p1.3; save status of p1.3 on CY
MOV 07, C; save carry in RAM bit location 07.
27. Write a program to see if bits 0 and 5 of register b r1. If they are not, make them so and save it in r0. JNB OFOH, NEXT – 1; JUMP if B.0 is low
SET BOFOH; Make bit B.0 high
NEXT – 1:JNB OF5H, NEXT – 2; JUMP if B.5 is low SETB OF5H; Make B.5 high
NEXT – 2: MOV R0, B; Save register B.
Copyright © 2018-2021 BrainKart.com; All Rights Reserved. (BS) Developed by Therithal info, Chennai.