ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

INSTRUCTION SET OF 8085: Data Transfer Instruction

Updated on July 27, 2015

Types of Instructions in 8085

There are various different types of instructions in 8085 assembly language programming. These instructions are used to program the 8085. Generally the instructions are written in terms of HEX Code, i.e. machine understandable code. The programs contain instructions and all the required programs are stored into memory chip of 8085 system from where in microprocessor reads the instructions and executes it.

Well its not easy to remember the operation code(op-codes) of all the instructions, the programs are first implemented over simulator or other assembly language programming editor and assembler. Here the assembly language instructions are used to program. These instructions are the combination of mnemonics and data.

The mnemonics are the English like words or abbreviation to denote the operation to be performed and the data indicates the information over which the operation is to be performed. Generally these instructions are divided into following types:

  • Data Transfer Instruction
  • Arithmetic Instructions
  • Logical Instructions
  • Branching Instructions
  • Control Instructions

Data Transfer Insructions

Instruction(Op-code)
Operands
Description
 
Rd, Rs
Copy the content of source register to destination register
MOV
M, Rs
Copy the content of source register to memory location
 
Rd, M
Copy the content of memory location to destination register
MVI
Rd, 8 bit Data
Copy the immediate data to destination register
 
M, 8 bit Data
Copy the immediate data to destination memory location
LDA
16 bit memory address
Load Accumulator from given memory location
LDAX
B or D register pair
Load Accumulator from memory address stored into given register pair
LXI
Reg pair, 16-bit data
Load register pair with 16 bit data
LHLD
16 bit address
Load HL pair from 16 bit content at given memory address
STA
16 bit address
Store the content of accumulator at given address
STAX
Register Pair
Store the content of Accumulator at the memory address stored into given register pair
SHLD
16 bit address
Store the content of HL pair at the given 16 bit memory address
XCHG
 
Exchange the content of HL with DE register
SPHL
 
Copy the content of HL pair to Stack (SP location)
XTHL
 
Exchange the content pf HL pair with top of the stack (SP location)
PCHL
 
Load PC to HL pair value
PUSH
Register Pair
Store the content of register pair to stack (SP location)
POP
Register Pair
Load the content of top of the stack(SP) to register pair
IN
8 bit port address
Load the content at given port to Accumulator
OUT
8 bit port address
Output the content of accumulator to given 8 bit port address

MOV: The instruction copies the content of source to destination. The content can be copied:

  • from one register to another register,
  • from memory location to register,
  • from register to memory location.

In case of last two options the memory location will be stored into HL pair.

For Example: MOV A, B // copy the content of register B into A

MOV A, M //copy the content of memory location specified by HL pair into Accumulator

MOV M, B //copy the content of register B into memory location specified by HL register pair.

MVI: The instruction stores the 8 bit immediate data into register or memory location. If the data is to be stored into memory location than the address of memory location is to be stored into HL pair. The MVI instruction mentions the data immediately into the instruction.

For Example: MVI B, 08h // stores 08h into register B

MVI M, 0Bh // stores 0Bh at memory location specified by HL pair.

LDA: The instruction loads the content of accumulator by the data stored at memory address specified into the instruction. The instruction is used to directly load the content of memory into accumulator.

For Example: LDA 2020h // loads the content at memory location 2020h into Accumulator.

LDAX: The instruction loads the 16 bit content from memory location specified by the given register pair into accumulator. The memory location where the data is stored will be into the given register pair. So we can say that the instruction will load accumulator indirectly from given register pair.

For Example: LDAX B //consider B=02h & C=21h, the instruction will load the accumulator from memory address(0221h) specified by the BC pair. So A=the content at [0221h] memory location.

LXI: The instruction will load the register pair by the 16 bit data stored from given memory location. The lower order register will be stored first from given memory location and higher order register will be loaded from the next memory location.

For Example: LXI D, 20544h // the content of E=data at 2054h and D=data at 2055h

LHLD: This instruction will load the content of HL pair from the given memory location. The 16 bit data from given memory location will be loaded into register pair HL.

For Example: LHLD 5678h // the content of L = data at 5678h location and H = data at 5679h location.

STA: The instruction stores the content of Accumulator at the given memory location. The 16 bit address is given into the instruction. To store the Accumulator value into the memory location this instruction is used.

For Example: STA 1478h // it stores the value of Accumulator at 1478h memory location.

STAX: Store the accumulator indirectly. The instruction stores the content of accumulator at memory location specified by the content of given register pair. The register pair mentioned into the instruction contains the memory location value where the accumulator is to be stored.

For Example: STAX D // it stores the Accumulator content at the memory location specified by register pair DE. If D=12h and E= 54h than the accumulator content is stored at memory location 1254h.

SHLD: The instruction stores the HL pair content into memory location. The content of L is stored at the memory location specified. The value of register H is stored at the next memory location.

For Example: SHLD 8523h //Stores the content of register L at 8523h and content of register H at 8524h.

XCHG: The instruction exchanges the content of HL pair and DE pair. The instruction exchanges the value of register H with D, and L with E.

For Example: XCHG // consider HL=0230h and DE = 1005h than the instruction will exchange to HL = 1005h and DE = 0230h

PCHL: The instruction will store the content HL pair to program counter (PC). If the address of the next instruction to be executed is to be changed than the value will be stored into HL pair and the instruction will store the HL pair content with new next address of instruction is loaded into Program Counter(PC).

For Example: PCHL // consider if HL=1234h than instruction will change the PC to 1234h.

SPHL: Stores the content of HL pair to top of the stack. The instruction is used to store the HL pair into stack.

For Example: SPHL // stores the content of L at SP location and H at SP+1 location

XTHL: The instruction exchanges the content of HL pair with the content of top of stack(SP). The value of L is exchanged with SP location content and the content of H register is exchanged with SP+1 location.

For Example: XTHL // consider HL=2134h and content as SP= 14h and SP+1= 54h than the instruction will exchange the HL and top of stack. Now HL=5414h and SP=34h and SP+1=21h

PUSH: The instruction will store the content of given register pair into stack at the top of the stack location. The SP is decremented and higher order register content is stored into stack. The SP is again decremented and lower order register content is stored into stack.

For Example: PUSH B // stored B register value to SP-1 and C register value at SP-2 and SP is decremented by 2

POP: The instruction will load the content of top of the stack to the given register pair. The content of location pointed by SP is stored into lower order register and the content of location pointed by SP+1 is loaded into the higher order register.

For Example: POP D // load the value at SP into E and SP+1 into D register. SP is incremented by 2.

IN: The instruction performs the input operation from I/O device. The instruction reads the port specified by the 8 bit port address mentioned into the instruction and loads the content into Accumulator.

For Example: IN 02h // Reads the port 02h and loads the 8 bit value into Accumulator.

OUT: The instruction performs output operation to I/O device. The instruction sends the content of accumulator to the given port. The port address is specified by the 8 bit address into the instruction.

For Example: OUT 15h // Sends the content of Accumulator to the port 15h.

How do you rate the article?

Cast your vote for Instruction Set
working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)