Skip to main content

Posts

Showing posts from April, 2018

Machine Control Instructions (Part-I) - RIM and SIM

RIM: RIM stands for Read Interrupt Mask. This instruction is used to copy the status of the interrupts into the accumulator. This instruction is also used to read the serial data through the SID (Serial Input Data) pin. No flags are affected. It is a one byte instruction. Implied addressing mode is used. Example: If after execution of RIM instruction, A = 0100 1011 = 4BH It shows that RST 7.5 is pending, RST5.5 and RST 6.5 are masked, interrupt enable flip flop is set and SID is zero. SIM: SIM stands for Serial Interrupt Mask. This instruction is used to mask the interrupts as desired. The command byte which is used to mask the interrupts is loaded into the accumulator. This instruction is also used to send the serial data through the SOD (Serial Output Data) pin. No flags are affected. It is a one byte instruction. Implied addressing mode is used. Example: If we want to mask RST 7.5 and RST 6.5 and unmask RST 5.5, then accumulator sh...

Input/Output Instructions

IN 8-bit addr: This instruction is used to copy the data from the port into the accumulator. The address of the port is given in the instruction.   OPERATION : A = (8-bit addr) No flags are affected. It is a two byte instruction. Direct addressing mode is used. Example: If port address = 20H, (20H) = 08H, then IN 20H ; This instruction will copy the data stored at port address 20H i.e. 08H into the accumulator. OUT 8-bit addr: This instruction is used to copy the contents of the accumulator to the output port. The address of the port is given in the instruction. OPERATION : (8-bit addr) = A No flags are affected. It is a two byte instruction. Direct addressing mode is used. Example: If A = 08H, then OUT 20H ; This instruction will copy the contents of the accumulator i.e. 08H to the port whose address is 20H.

Stack Operations Instructions (Part-II) - SPHL and XTHL

SPHL: This instruction copies the contents of HL register pair to the stack pointer (SP). It means that the stack pointer will now point to the memory location whose address was given in the HL register pair. No flags are affected. It is a one byte instruction. Register addressing mode is used. Example: If HL = 2030H, then SPHL ; This instruction will copy 2030H into SP. So SP will point to the memory location 2030H. XTHL: This instruction exchanges the contents of the memory location pointed by stack pointer with the contents of the L register and the contents of the next memory location with the contents of H register. This instruction does not alter the contents of the stack pointer. No flags are affected. It is a one byte instruction. Register Indirect addressing mode is used. Example: If HL = 5601H, SP = 2000H, (2000H) = 30H and (2001H) = 20H, then XTHL ; This instruction will exchange the contents of the memory location 2000H i.e. 3...

Stack Operations Instructions (Part-I) - PUSH and POP

WHAT IS A STACK : The stack is a part of read/write memory which is used for the purpose of storing information temporarily. When the information is written on the stack, the operation is called PUSH . When the information is read from the stack, the operation is called POP . The stack is operated with the help of special memory pointer register called stack pointer (SP) . Stack pointer (SP) gives the address of the memory location where the information is to written or to be read. PUSH Rp: This instruction is used to write 16-bit data on the stack. It decrements stack pointer by one. Then the contents of higher order register of Rp are copied to the memory location pointed by stack pointer. Then stack pointer is again decremented by one. The contents of lower order register of Rp are copied to the memory location pointed by stack pointer. Rp can by BC, DE, HL or PSW. NOTE: PSW stands for program status word. It has accumulator (A register) as higher order...

Branching Group Instructions (Part-IV) - PCHL and RST n

PCHL: This instruction loads the contents of HL register pair into the program counter (PC). Thus the program control is transferred to the address given in HL register pair. No flags are affected. It is a one byte instruction. Register addressing mode is used. Example: If HL = 4000H PCHL ; This instruction will load PC with 4000H and program control is transferred at 4000H. RST n: This instruction transfers the program control to the specific memory location. It is like a CALL instruction but in this instruction, the program control is transferred to a fixed address. These fixed addresses are called vector addresses. The processor calculates these vector addresses by multiplying RST number i.e. n by 8. Just like CALL instruction, before transferring the program control to the vector address, it saves the current contents of program counter on the stack. No flags are affected. It is a one byte instruction. Register indirect addressing mode is use...

Branching Group Instructions (Part-III) - Return and Conditional return

RET: This instruction transfers the program control from subroutine or subprogram to the main program. It pops the address of the instruction next to CALL instruction in the main program from the stack and loads program counter with this address. Then stack pointer is incremented by two. No flags are affected. It is a one byte instruction. Register indirect addressing mode is used because the return address is available in the memory location pointed by stack pointer. Example: If SP = 2000H RET ; This instruction will load program counter with 3000H and will transfer program control to 3000H. Before execution: After execution: Rcond: When the condition is true, this instruction transfers the program control from subprogram or subroutine to the main program. It pops the address of the instruction next to CALL instruction from the stack and loads program counter with this address. Then stack pointer is incremented by two. When the condition is fal...

Branching Group Instructions (Part-II) - Call and Conditional call

CALL addr: The CALL instruction is used to transfer the program control to a subprogram or subroutine. NOTE: A subroutine is a group of instructions which performs a particular task and is executed a number of times. Rather than writing this repeated part again and again, the programmer writes this part only once. It is written separately. The processor executes this part by transferring program control from main program to the subroutine program. After completion of execution of subroutine, the program control is back to the main program. Subroutine Program The CALL instruction transfers the program control to the address given in the instruction. The current contents of program counter (PC) are copied into the stack. NOTE: Stack is a part of read/write memory which is used for storing temporary results and addresses. Then this instruction decrements stack pointer (SP) by two. No flags are affected. It is a three byte instruction. Immediate add...

Questions and Answers of 8085 Microprocessor (Part-II)

What are the different advances in semiconductor technology ? SSI - Small Scale Integration (10 transistors/chip) MSI - Medium Scale Integration (10 to 100 transistors/chip) LSI - Large Scale Integration (100 to 10,000 transistors/chip) VLSI - Very Large Scale Integration (10,000 to 10^6 transistors/chip) ULSI - Ultra Large Scale Integration (10^6 to 10^7 transistors/chip) GSI - Giga Scale Integration (more than 10^7 transistors/chip) What are the various functions of ALU ? The various functions performed by ALU are: Addition Subtraction AND  OR EX-OR Complement Shift right Shift left Increment  Decrement What is the function of READY signal ? READY signal is used for synchronization of slower peripherals with the microprocessor. It senses whether the peripheral is ready or not to transfer the data. If the peripheral is not ready, the processor waits. Why AD0 - AD7 lines are multiplexed ? The data bus (D0 - D7) and the lower half...

Questions and Answers of 8085 Microprocessor (Part-I)

What is a microprocessor ? A microprocessor is a multipurpose, programmable, clock driven register and ALU based electronic device. It reads binary instructions from memory, accepts binary data as input, processes data and provides result as output. What are the various registers in 8085 ? 8085 has 8-bit accumulator (A), six 8-bit general purpose registers B, C, D, E, H and L, temporary data register, W and Z registers, flag register, instruction register, 16-bit program counter (PC) and 16-bit stack pointer (SP). What are the various flags in a flag register ? Flag register is an 8-bit register in which five of the bits carry significant information in form of flags. They are S (Sign flag), Z (Zero flag), AC (Auxiliary Carry flag), P (Parity flag) and CY (Carry flag). What is the function of accumulator ? Accumulator is an 8-bit register which is used in arithmetic, logic, load, store and input/output operations. It is also used to store the result of a...

Branching Group Instructions (Part-I) - Jump and Conditional jump

JMP addr: This instruction loads the program counter with the address given in the instruction. Then the program execution continues from this location. No flags are affected. It is a three byte instruction. Immediate addressing mode is used since the operand is given in the instruction itself. Example: JMP 5600H ; This instruction will load PC with 5600H and processor will fetch next instruction from 5600H. JMP C240H ; This instruction will load PC with C240H and processor will fetch next instruction from C240H. Jcond addr: If the condition is true or satisfied, then this instruction causes a jump to an address given in the instruction. If the condition is false or not satisfied, then this instruction just check and proceed further to execute the next instruction after it. If condition is true, PC = addr and if condition is false, PC = PC + 3. No flags are affected. Flags are only checked. It is a three byte instruction. Immediate addressing mode is used...