× back

Programming Model (8085)

Introduction to 8085 Programming Model

The 8085 programming model serves as the foundation for developing assembly language programs for the 8085 microprocessor. This model defines the architecture and organization of key elements that contribute to the execution of instructions and data manipulation.

Flag Register

The flag register is a vital component in the 8085 programming model, providing information about the status and conditions of the processor.

Numerical 1:
Assume A (Accumulator) = 88H & B = 99H
determine the status of all flags and accumulator content when following 8085 instruction is executed: Add B (A ← A + B).

Numerical 2:
A = 13H and B = 24H
determine the status of all flags when following 8085 instruction is executed: SUB B (A ← A - B).

Memory Mapped I/O and Peripheral Mapped I/O in 8085 Microprocessor

In the world of microprocessor architecture, efficient communication between the processor and external devices is essential for system functionality. Two key concepts that facilitate this communication in the 8085 microprocessor are memory mapped I/O and peripheral mapped I/O. These techniques play a crucial role in interfacing the microprocessor with memory devices, input/output (I/O) devices, and other peripherals. Memory mapped I/O involves treating I/O devices as if they were memory locations, simplifying access through standard memory read and write instructions. On the other hand, peripheral mapped I/O assigns specific addresses to I/O ports separate from the memory address space, requiring dedicated I/O instructions for communication. Understanding these concepts is fundamental for designing efficient systems and programming interfaces in 8085-based applications.

Memory Mapped I/O

  • Definition: Memory mapped I/O is a technique where the microprocessor treats I/O devices as if they were memory locations. This means that I/O devices are assigned specific memory addresses, and accessing these addresses allows the microprocessor to communicate with the devices.
  • Usage: In the 8085 microprocessor, memory mapped I/O is used to access I/O devices by mapping them to specific memory addresses. This simplifies programming as I/O operations are performed using standard memory read and write instructions.
  • Addressing: Memory mapped I/O uses memory addresses to access I/O devices, making them appear as part of the memory address space.
  • Example: Accessing an input device (e.g., keyboard) or an output device (e.g., display) through memory addresses mapped to specific I/O ports.

Example:

Reading from an input device mapped to a memory address:

                        
MOV A, M  ; Move data from memory (input device address) to accumulator
                        
                    

Writing to an output device mapped to a memory address:

                        
MOV M, A  ; Move data from accumulator to memory (output device address)
                        
                    

Peripheral Mapped I/O:

  • Definition: Peripheral mapped I/O involves assigning specific addresses to I/O ports separate from the memory address space. Each I/O port is assigned a unique address, allowing the microprocessor to communicate with external devices connected to these ports.
  • Usage: In the 8085 microprocessor, peripheral mapped I/O is used to access external devices through dedicated I/O ports. Instructions and signals specific to peripheral devices are utilized for data transfer, control, and communication, enabling seamless interaction between the microprocessor and external hardware components. This method allows the microprocessor to manage input and output operations efficiently, supporting various applications in embedded systems, industrial automation, and computer peripherals interfacing.
  • Addressing: Peripheral mapped I/O uses separate port addresses for each I/O device, distinct from memory addresses.
  • Example: Reading input from a keyboard connected to a specific I/O port address or sending output to a printer connected to another I/O port address.

Example:

Reading from an input device connected to an I/O port:

                    
IN 30H  ; Input data from port address 30H into accumulator
                    
                

Writing to an output device connected to an I/O port:

                    
OUT 40H  ; Output data from accumulator to port address 40H
                    
                

Machine Cycle

Note:

Determine the machine cycles and total T-states required for execution of the following instructions: