Addressing Modes

8:54 AM 6 Comments




Definition of terms:

Register - Register is a main part in the microcontrollers and processors that provide a fast way to collect and store data. If we want to manipulate data with a controller or processor by performing addition, subtraction, and so on, we cannot do that directly in the memory, but it needs registers to process and store the data. Registers contain the address of the memory location where the data is to be stored.

Internal Data Memory - Up to 256 bytes of internal data memory are available depending on the 8051 derivative. Locations available to the user occupy addressing space from 0 to 7Fh, i.e. first 128 registers and this part of RAM is divided in several blocks. The first 128 bytes of internal data memory are both directly and indirectly addressable. The upper 128 bytes of data memory (from 0x80 to 0xFF) can be addressed only indirectly.

Special Function Register (SFR) - SFRs are accessed as if they were normal Internal RAM. The only difference is that Internal RAM is from address 00h through 7Fh whereas SFR registers exist in the address range of 80h through Ffh.

Program Memory (ROM) - Program Memory (ROM) is used for permanent saving program (CODE) being executed. The memory is read only. Depending on the settings made in compiler, program memory may also used to store a constant variables. The 8051 executes programs stored in program memory only.


Read more:








6 comments:

  1. 8051 Microcontroller contains how many register?

    ReplyDelete
    Replies
    1. Hi Shena! The 8051 microcontroller contains mainly two types of registers:
      General purpose registers (Byte addressable registers)
      Special function registers (Bit addressable registers)

      General purpose registers include Banks and Registers, 4 banks(B0-B3) and each banks contains eight general purpose registers (R0-R7), and PSW (Program Status Word) Register. While SFR have 21 namely: the Accumulator, B register, Port registers (P0-P3), and many more!

      know more about the registers of 8051 here:
      http://www.circuitstoday.com/8051-special-function-registers-and-ports
      https://www.elprocus.com/know-about-types-of-registers-in-8051-microcontroller/

      Delete
  2. Hi maam, can i use address as a temporary register? Is 8051 has a temporary address or register?

    ReplyDelete
    Replies
    1. Hi marco! You can move data or value to an address by direct addressing. For example you want to store the value of 80 inside the address 25H, you can do this by the instruction: MOV 25H, #80.

      But, if you want to manipulate the data inside an address, you need to move it either in the accumulator, b register, or from registers 0-7. since we can't do it directly inside an address. that is the main function of the registers. But if you wanted to store value inside an address, yes it is possible :) hope this helps!

      Delete
  3. Is it important to know the position of the stack pointer when it comes to the addressing modes? How will I know the current position of the stack pointer?

    ReplyDelete
    Replies
    1. Hi Micah! the stack pointer and the indexed addressing is not related with each other. When we say Stack pointer it is a small register that stores the address of the last program request in a stack. It is important when you are using the call instruction since the stack pointer is the one who determines which address to return. While in indexed addressing, you manipulate the data pointer.

      Delete