# Reset Accumulator (8085 & 8086 microprocessor)

• Difficulty Level : Basic
• Last Updated : 22 May, 2018

1. Problem – Write the 8085 instructions which reset the accumulator.

Solution – There are 4 instructions to reset the accumulator in 8085. These instructions are:

S.No.MNEMONICSCOMMENT
1MVI A, 00A <- 00
2ANI 00A AND 00
3XRA AA XOR A
4SUB AA <- A – A

Explanation –

1. MVI A, 00: instruction copies 00 to A.
2. ANI 00: instruction performs bit by bit AND operation of source operand (i.e. 00) to the destination operand (i.e. the accumulator A) and store the result in accumulator A.
3. XRA A: instruction performs XOR operation between source operand and destination operand and store the result in the accumulator. Here, source and destination operand both are same i.e. A. Therefore, the result after performing XOR operation, stored in the accumulator is 00.
4. SUB A: operation subtracts the contents of source operand(here, source register is A) from the contents of accumulator and store the result in the accumulator itself. Since, the source and destination operand are same. Therefore, accumulator A = 00.

2. Problem – Write 8086 instructions which are used to reset accumulator.

Solution – There are 4 instructions in 8086 to reset the accumulator. These instructions are:

S.No.MNEMONICSCOMMENT
1MOV AX, 0000AX <- 0000
2AND AX, 0000AX <- AX AND 0000
3XOR AX, AXAX <- AX XOR AX
4SUB AX, AXAX <- AX – AX

Explanation – Register AX is used.

1. MOV AX, 0000: copies 0000 to AX.
2. AND AX, 0000: operation performs bit by bit ANDs the source operand (0000) to the destination operand and store the result in AX.
3. XOR AX, AX: performs the XOR operation in values of source register and destination register and store the result in AX. The source and destination operands, both are same. Therefore, AX = 0.
4. SUB AX, AX: operation subtracts the value of source operand from the value of destination operand and store the result in AX. Here, both the operands are same .Therefore, AX = 0.
My Personal Notes arrow_drop_up
{"ft_lang_label":"__label__en","ft_lang_prob":0.7786393,"math_prob":0.9343209,"size":2013,"snap":"2022-05-2022-21","text_gpt3_token_len":548,"char_repetition_ratio":0.17770036,"word_repetition_ratio":0.08732394,"special_character_ratio":0.29061103,"punctuation_ratio":0.15671642,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9792988,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-26T15:49:03Z\",\"WARC-Record-ID\":\"<urn:uuid:46097fbb-4f7e-4f65-ab10-b52168035f57>\",\"Content-Length\":\"120458\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c850c934-ecd3-4ac0-b9ad-c7b7ae7a9656>\",\"WARC-Concurrent-To\":\"<urn:uuid:2ae64acb-ac22-4881-975e-0c8690396dac>\",\"WARC-IP-Address\":\"23.15.9.42\",\"WARC-Target-URI\":\"https://www.geeksforgeeks.org/reset-accumulator-8085-8086-microprocessor/?ref=lbp\",\"WARC-Payload-Digest\":\"sha1:WN4SMIDEKTDW7NQVHU6SD6M752BWYBCJ\",\"WARC-Block-Digest\":\"sha1:EAK5VCOVEKCSOBLOQR6GELMKSQB5FIKH\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662606992.69_warc_CC-MAIN-20220526131456-20220526161456-00451.warc.gz\"}"}