Data Transfer Instructions of 8085 – Instruction Set of 8085 Microprocessor – Microprocessor

Data Transfer Instructions of 8085 – Instruction Set of 8085 Microprocessor – Microprocessor


Do subscribe to Ekeeda channel and press bell icon to get updates about latest engineering HSC and IIT-JEE Mains and advanced videos. Hello Friends, In this video we are going to study about the instruction set of eight zero eight five in the instruction set all the instructions which are supported by the eight zero eight five Microprocessor they are included. So the instruction set of the eight zero eight five and the minds have all the instructions of a eight zero eight five and these instructions they are divided into five categories. First is data transfer instructions then we have arithmetic instructions logical instructions branching instructions and machine control instructions. So let us study all the instructions of the instruction set of eight zero eight five the instructions they are divided into the five categories so these are the five categories in which the instructions of the su-85 are divided first is data transfer arithmetic logical branching and machine control instructions first we will start with data transfer instructions the instructions in this category they transfer the data from one location to another that is from source to destination the data is transferred but the content of the source it is not altered so we can say that it is a kind of copying operation that the contents of the source they are copied to the destination first instruction under this category is in Oh V this instruction it copied the contents from the best source to the destination so here we have our D and our s this is the source register and this is our D is the destination register so the contents of the source register they are transferred to the destination resistor also we can have memory and the source register and we can have a destination register and a memory location so they can be three types of operands in this instruction in the first if we have move our D and our s then the contents of the source register they are copied to the destination register if we have M in RS then the contents of the source register are copied to the memory location the address of the memory location is is specified by the hlpr register and we have our D and M then the contents of the memory location are copied into the destination register so what this instruction is doing so we can have these three operands our demos destination register RS is source register and M is the memory location so this instruction is copying the contents of the source registered into the destination register the contents of the source register are not altered that is when suppose this is having a numbered 0 6 so this number will be copied to the destination register but social disturb will still hold its content it will be having 0 6 in it now if one of the operand in terms of memory location like M and M here so its location s is specified by the contents of the HL pair register how we are going to get the address of this memory location it will be specified in the HL player register if we take examples the example of this instructions are we have move a comma B so the contents of the B register they are copied into the accumulator also we can have move C comma M so the contents of the memory location which is given in the Etzel pair suppose it is given 8 0 5 0 so this memory location will be having the data and that data will be copied into the C the system so this is the first data transfer instruction next instruction is MV I Rd offer data or it can be M comma data so this instruction is just copying the immediate data data is given in the instruction and this data is moved into the destination register or into the memory location again if the operand is memory then the address of this memory location is specified by the hlpr register so if one of the operand is memory its location is specified by the HL resistor pin if we take examples then example of this instruction are in VI B comma 57 H or it can be m VI M comma 57 inch edges here denoting that this number it is in hexadecimal notation and m VI is move image 8 data so it is moving the data which is given in the instruction into the register B or to the memory location M the address of this memory location is specified by the HL pair register the HL pay register suppose it is having 8 0 5 0 so at this memory location this number 57 will be copied so earlier was moved or data move the contents of the register or memory to another register here we are moving the data to the register or memory third data transfer instruction is led a and the operand is a 16-bit address this is our output and this is our operand on which the operation has to be performed this instruction is Lord accumulator what it is doing so this instruction is loading the accumulator with the contents of this 16-bit address the address is specified in the instruction itself and the contents of the source they are not altered suppose we have a 16-bit address eight zero five zero and all this memory location a number is being saved and this number is we have as 24 so this number will be copied into the accumulator so here the accumulator is going to get the same number 24 but the contents of this memory location 8 0 5 0 that is 24 it is not changed it will remain 24 so this instruction is loading the accumulator with the contents of the memory location if we take an example when we have LD a 2 0 3 4 or we have LD a any address any memory the 16-bit address can be here so X Y Z so the contents of this memory location will be copied into the accumulator next instruction is LX I this instruction is load register pair in Egypt this I is for the immediate data and we have the operand as the registered pair and the 16-bit data so this instruction is loading the 16-bit data which is given in the instruction into the register pair which is also specified in the instruction if we take an example then example of this instruction is LX I H comma 2 0 3 4 here in the instruction we have the register pair this register pair is HL in the 8 0 8 5 we have the registers as b c d e h and l these are the six registers present in the 8 0 8 5 and these 6 resistors form 3 register pair B with C D with E and H with L so these are the three resistors pairs now here we have h written so this is denoting the actual register pair so in this it’s a registered pair we will have the 16-bit data 2 0 3 4 so this construction is loading the register pair with the immediate data given in the instruction itself next instruction is L be a X B comma D register tail what this instruction means it is loading the accumulator indirectly so this instruction is loading the accumulator indirectly the contents of the register payer it point to a memory location we have here the register bell B and D H a register pair is not used so B means BC resistor pair and D means in de register pin so the contents of the register pair they point to a memory location suppose in BC we are using so BC register pair we will be having a memory location in it suppose we have 2 0 3 4 this memory location is being saved in the BC register pair so it points to a memory location this instruction will copy the content of that memory location into the accumulator now at this memory location 2 0 3 for a number is being stored suppose 40 number is stored there so this number will be copied into the accumulator so 40 get copied into the accumulator copies the contents of that memory location into the accumulator now one thing we have to note the contents of either the register pair the contents of register pair or the memory location and the contents of the memory location memory location is having 40 they both are not change only the accumulator is having that number this number is being copied into the accumulator also so you can see that this truck this these instructions they are just transferring the contents or copying the contents they are not like changing the contents were picking the contents from here and storing it at another place they are just walking or transferring the data so this was Lda X that is loading the accumulator indirectly next instruction is LH LD so this instruction is loading the H and L registers directly HL is in the instruction itself so you can remember that it is loading the H and L registers directly and the operand is a 16-bit address so this will be a memory location [Music] so this instruction is copying the contents of the memory location which is pointed out by the 16-bit address into the register l and copies the content of the next memory location into the register H let’s take an example we have an example as l h LD – 0 5 0 so this is the 16-bit address which is denoting the memory location so at this memory location suppose this is 2 0 4 0 we are having a numbered 3 e now this number it will be copied into the register l and the contents of the next memory location next memory location is 2 0 4 1 and suppose it is having 4 F so the contents of the next memory location of copy didn’t read into register edge so if we have here the register pair H L so L will have 3 e and H will have 4 F so this instruction is loading the H and L registers directly directly because the address is given to us just the contents of this memory location they are to be transferred or copied into the edge will register pair the contents of the source memory location that is three E and four F they are not altered they remains the same they have just copied into the agent register pair so this was the LH LD instruction next instruction is st a 16-bit address this instruction is a store accumulator so this instruction is store accumulator direct so the contents of the accumulator they have copied into the memory location specified by the operand let’s take an example we have HT a 4 3 5 0 H this is a memory location 4 3 5 0 so the contents of the accumulator suppose accumulator is having 5 a this is a number so this number will be copied into the memory location which is a specified by the operand so apprentice is specifying this memory location 4 3 5 0 so on this memory location this number 5 a will get stored so we are storing the accumulator at a memory location directly because the address of that memory location is given in the instruction itself now this instruction it is a 3 by 10 struction when we are going to save this instruction into the memory of the microprocessor then 4 St we will have a machine code then 443 we will have one byte and 450 we will have one bite so 1 byte for this one byte 443 and one byte for 50 so this will be a three byte instruction now the second byte when we are going to store it then for sta suppose we have a machine code like 46 we have a machine code for a steam then we are going to store this 50 first the lower order address will be stored so 46 then 50 and then the higher order address 43 will be stored so in this way this instruction will be stored in the microprocessor memory so me all the time remember that we have the second byte is specifying the lower order address and the third byte is specifying the higher order address so this was the storing the accumulator directly HTA instruction the next instruction is s Dax register pay this is the opcode and this is our operand this instruction is store the accumulator in direct so this instruction it is storing the contents of the accumulator into the memory location which is specified by the operand here the operand is the register pair so the contents of the accumulator they are stored on the in the register pail the but the contents of the accumulator they are not altered if we take an example we have a ste a X B so the contents of the accumulator they are copied into the memory location which is specified by the operand now this is our B register so it is showing the BC register pair now this BC register pair it is suppose having the memory location 2 0 3 4 since BC so the contents of the accumulator suppose contents of accumulator are 20 so this content will be stored at the memory location which is specified by this register pair so on 2 0 3 4 memory location this number 20 will be stored all copied so this instruction is storing the accumulator indirectly because the location at which the accumulator has to be stored the contents of the accumulator are to be copied they are not directly given in the instruction they are given in the register pair so it is an indirect addressing of the operand so it is storing the accumulator indirectly so this was sta X now next instruction is sh l ly and then we have 16-bit address it means store the store the H and L registers directly the address of the memory location is given to you the 16-bit address so this 16-bit address you have to store in the HL be a register so the contents of the register el are stored into the memory location specified by the 16-bit address and the contents of the H register they are stored in the memory location just after this so this instruction is storing the H and L registers directly that is the contents of the HL n L registers they are directly stored at this 16-bit address so the contents of the register L they are stored at the memory location which is specified by this address and the contents of the register H are stored in the next memory location if we take an example then we have SH LD 2 4 7 0 so 2 4 7 0 it is a memory location this is 2 4 7 0 and we have H and L register pale now this resistor pair is having a number in it we suppose we have 3 0 and 2 0 so the L resistor it is having 20 so 20 will be stored at this memory location and that next memory location 2 4 7 bun the edge register pair is being stored so it is saying that the contents of register L are stored in the memory location which is specified by the 16-bit address that is two four seven zero and the contents of register age are stored in the next memory location that is two four seven one but the contents of the actual register pair they are not altered now this instruction when it is stored in the in the memory of the microprocessor so it will be a three byte instruction shld will have a machine code then we will store 70 and then 24 the lower order address will be stored first and then the higher order address will be stored so this will be a three byte instruction one by four shld one byte for 70 and one byte for 24 so this instruction is storing the HL register pair directly directly because the address at which the contents are to be stored it is given in the instruction itself so it is a kind of direct memory addressing next instruction we have is xchg exchange this instruction is having no operand in it that is why I have written none here and this is exchange H and is with D and E we have the registers pair HL b c d e so it is involving a chill and de register sphere so operand and operation both is given in the instruction itself so it is a kind of implicit addressing because the operand is already given into in the instruction that is exchange it’s an L register pair with the D and E resistor pin so this instruction is just exchanging the contents of the register pair HL with the Dean if we take example then in the example in program we just write the instruction X CAG no operand has to be specified because it is given in the instruction itself it’s a resistor pair suppose it is having eight zero five zero and de registered pair it is having nine zero five zero so these contents they will be exchanged let’s take here nine zero six zero so we have a child resistor pair has eight zero five zero and D has nine zero six zero so the contents of D they are exchanged with H and H will come into D similarly if the contents of L will come into e and the contents of e will go into L so when this instruction is executed the new contents of each cell will be 90 and 60 and be e will be 80 and 15 so this instruction is exchanging the contents of HL with de okay next instruction is SPH in and it is also having no operand so what it is doing it is copying H and L registers to the stack pointer so the contents of this H will register pair they are 4p to the stack pointer there is no operand operand is specified in the instruction in cell HL and the stack pointer so what is this instruction does so this instruction loads the contents of the H and L register into the stack pointer register stack pointer register it is a 16-bit register and it denotes the starting of the stack that from which memory location the stack is starting so it is defining the beginning of the stack stack is an array of memory locations so suppose in HL we have the memory address 2 0 3 4 and this memory address will be load in the stack pointer stack pointer is 16-bit so this address will be completely transferred into the stack pointer register 2 0 3 for the H register it is showing the higher order address and L register it is showing the lower order address so we have the addresses 2 0 3 4 and at this address the stack pointer will be initialized so the stack will start from this memory location so if it wants to execute this instruction then we will just write the example is SPH n because there is no operand operand is specified in the instruction so just write s phl to execute this instruction next we have x th end so this instruction XD HL it is also having no operand this instruction exchanged the contents of Edsel with the top of stack so the operands are specified in the instruction itself and you have to exchange the contents of a gel with the top of step now the contents of the L register they are exchanged to with the stack location pointed out by the contents of the stack pointer register stack pointer register it is showing the beginning of the stack so in the stack pointer register if we are having 8 0 5 0 so the contents of this memory location suppose at 8 0 5 0 we have 30 stored so this will be exchange with the contents of L register a chilled resistor pair suppose it is having 2 0 3 4 so this location stack pointer is initialized at 8 0 5 0 and this memory location has 30 number stone so this will be exchange to make the L register so now at 8:05 0:34 will come and in the L register we will have 13 now at the next memory location s P plus 1 that is at 8:05 1 if we have suppose 21 then this 21 will be exchanged with the H resistor so 20 will come here and 21 will go there so we will have 21 here and this 20 will come at 8:05 1 so the contents of the stack with the top of the stack that is at which the beginning of the top beginning of the stack that is the stack pointer register so their contents will be exchanged with the HL register pair so it is having no operand specified in the instruction we have in implicit addressing mode here because since the operand is specified in the instruction it’s same so this was X th n next instruction we have is push register pay so this instruction is push the registered pair on to step so this instruction is also related with the stack so this bush shrub mr. pear this instruction it is used when we are dealing with stack operation so the contents of the register pair they are copied onto the stack the register pair is given in the instruction itself so if we take an example so example of this is push be or push be okay we can have any of the resistor pair here so the contents of the resistor pair they are copied onto the stack how they are copied suppose we have in BC register we have numbers stored there suppose 7f and 3e are stored in BC resistor pair then the stack pointer is decremented now in the stack pointer stack pointer is showing us the beginning of the stack okay the location from which the stack is starting so here we have 8 0 5 0 now the stack pointer is decremented so it will be decreased by 1 so if we will have 8 0 F F 0 8 0 5 0 so it will be 8 0 4 sorry 8 0 4 9 here so stack pointer is decremented and the contents of the higher order resistor now we have bc resistor pair we have de registered pair and we have h L resistor pair so higher order resistors are H V and D so the contents of these higher order register pair are copied on to that location at 8:04 9 we will have the contents of the higher order register B that is 7 F then the stack pointer is again decremented so we will have here 8 0 4 8 and the contents of the door or the register they are copied to that location so on see we have 3 e so 3 e will be copied to 8 0 4 8 so this is how this instruction cache works push and then we have the register pair it can be be B or it can be a children astir pair so we the contents of the stack pointer they will be decremented first the higher order register is copied and then the lower order register is copied there at a cen and here B D and H will be copied and lower order we will have C E and a so this was the pushrods instruction then we have pop instruction so this instruction is also related to the stack operation here the operand is the register pair and it will pop up the stack to the register pair so the contents of the stack they will now go to the register pair so this instruction a top of the stack to the resistor pair the contents of the memory location which is pointed out by the stack pointer register they are copied to the lower order register now suppose the stack pointer it is initialized by the memory location 8 0 5 0 so the contents of this memory location suppose at 8 0 5 0 we have the content 7e so this content it will be copied to the lower order register which is specified here suppose we take an example that we have for H ok so we have the register fair H n so this stack pointer is having the address 8 0 5 0 and it is a storing 7 e so 7 e will be copied to the lower order register and in if we have B here and D here then in C and E this content will be copied then the stack pointer is incremented by 1 so now the stack pointer will becomes 8 0 5 1 now the contents of that memory location now suppose at 8:05 1 we have 5 F so this will be copied to the higher order register higher order will be if we have BC resistor pair then it will be B if we have de register pair then it will be D and if we have HL then it will be H so in H this 5 F will be copied now the stack pointer it is again incremented by 1 so again the this stack pointer will be incremented and now it will be 8:05 – so after this pop instruction the contents of the stack pointer they will be implemented by first here it will be incremented and then again it will be incremented so 2 times the increment is done so we have 8:05 2 as the last content of the stack pointer so this is how the pop instruction works it will copy the contents of the memory location switches are stored in the stack pointer into the register pin next instruction is out so this instruction out it has the operand as an 8-bit port address and this instruction it outputs the data from the accumulator to a port with 8-bit address so port address is given in the instruction itself and the accumulator contents they are sent to that port address so the contents of the accumulator suppose in accumulator we have a number for F so this number will be copied into the input/output port and the address of that input output port is specified by the operand and operand it is given in the instruction suppose we take an example out 87 so 87 is the address of the port so on this address this content will be copied so on 87 we will have for F so this is the out instruction next we have in instruction so this instruction in it also has an operand which is an 8-bit port address so this instruction inputs the data to the accumulator from a port with 8-bit address so the contents of the port which is having this 8-bit address they are copied into the accumulator so this is a kind of input that is why we have written I N and when the contents of accumulator are sent to the port then it will be a kind of output function so we use the out function instruction for that so the contents of the input port which is designated by the 8-bit address which is the operand of the instruction they are read and loaded into the accumulator so example is I n 82 so it is the 8-bit port address and at 82 if a number is the stored suppose to a is stored at this memory look at this port address so this will be copied into the accumulator and accumulator will get to a here okay so this was in instruction this was the last data transfer instructions so we have studied the data transfer instructions which are transferring the contents of either a register or a memory address port address or a stack into another register or memory location or into the accumulator in these instructions you can notice that the contents of the source register or the source location they are not altered they remains the same so it is a kind of copy the contents from one location to another location the next category of instruction is arithmetic instructions

7 thoughts to “Data Transfer Instructions of 8085 – Instruction Set of 8085 Microprocessor – Microprocessor”

  1. Hello Friends,

    Watch Complete Video Series of Subject Microprocessor only on Ekeeda Application.

    Use Coupon Code "NEWUSER" and access any one Subject free for 3 days!

    Download Ekeeda Application and take advantage of this offer.

    Android:- https://play.google.com/store/apps/details?id=student.ekeeda.com.ekeeda_student&hl=en

    iOS:- https://itunes.apple.com/tt/app/ekeeda/id1442131224

Leave a Reply

Your email address will not be published. Required fields are marked *