What is Direct Addressing Mode in Assembly Language?

29 Apr 2023 Balmiki Mandal 0 Assembly language

Direct Addressing Mode in Assembly Language

The direct addressing mode is a fundamental concept in assembly language programming. In this approach, the programmer specifies an exact memory address to obtain a data value. This mode of addressing is especially useful when dealing with short arrays and global variables.

In direct addressing mode, the programmer has control over the exact memory address to use for retrieving a data value. This allows for highly optimized and efficient code as the programmer can efficiently manage access to data without having to search through items in a large array or linked list. This is why direct addressing mode is often used for small arrays and global variables that require speedy read/write access.

When using direct addressing mode, the programmer must identify any changes that could cause the data item's address to change. If the data is stored in a register, the programmer must keep track of which register is currently holding the data. If the data is stored on the stack, the programmer must ensure that the stack pointer's value accounts for any pops or pushes that may occur. It is also important to make sure the address being used is within the valid address range of the processor.

In conclusion, direct addressing mode is a powerful and essential tool in assembly language programming. It allows the programmer to have exact control over the memory address of a data item and can result in very optimized code. It is important, however, to be aware of any changes that could affect the address being used. This will help ensure that the code is robust and bug-free.

 

Note

  • Specify data by its 8-bit address
  • At least one of the operand is specified by an 8 bit address field 
  • Internal data Ram and SFRs can be directly addressed 

 

Possibillities

  • MOV Addr, #data(8-bit)
  • MOV A, Addr
  • MOV Addr, A
  • MOVE Rn,Addr
  • MOV Addr,Rn
  • MOV Addr1,Addr2

 

Example

MOV A, 0X70     ;copy content of RAM at 70h to "A"
MOV 0xD0, A    ;put contents of  a into PSW I.E., PSW address is  0Xd0

 

 

 

 

 

 

 

BY: Balmiki Mandal

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.