banner



What Happens If A Computer Has No Status Register

Register content and Flag status after Instructions

Improve Article

Save Commodity

Like Article

Basically, y'all are given a gear up of instructions and the initial content of the registers and flags of 8085 microprocessor. You have to find the content of the registers and flag condition after each education.

Initially,

Below is the set of the instructions:

            SUB A MOV B, A DCR B INR B SUI 01H HLT                      


Assumption:
Each didactics will apply the result of the previous didactics for registers. Following is the description of each teaching with register content and flag status:

  • Instruction-i:
    SUB A instruction will subtract the content of the accumulator itself. It is used to clear the content of the accumulator. Subsequently this operation the content of the registers and flags volition exist like figure given below.

  • Instruction-two:
    MOV B, A will copy the content from source register (A) to the destination register (B). Since information technology is the Information Transfer pedagogy so it will not affect any flag. Afterward this operation the content of the registers and flags will be like effigy given below.

  • Instruction-3:
    DCR B will subtract the content of the register B past ane. DCR operation doesn't affect Comport flag(CY).
                    B-00H                0 0 0 0  0 0 0 0              

    For DCR B takes the 2's complement of the 01H, 2's Complement of 01H:

                    0 0 0 0  0 0 0 one  1 1 1 1  1 1 1 0  (1's complement)               + 1 ------------------  1 i 1 1  one 1 1 1  ------------------   +(00)  0 0 0 0  0 0 0 0  -----------------------        i one 1 ane  1 i 1 1    ----------------------              

    (FFH) this will exist the content of the B. So after this operation the content of the registers and flag will be like figure given below.

  • Instruction-4:
    INR B will increase the content of the register B by 1. INR performance doesn't affect Carry flag(CY).
                    B(FFH)                1 one 1 ane  1 1 1 1  +(01)   0 0 0 0  0 0 0 1         ------------------ CY=1    0 0 0 0  0 0 0 0          ------------------              

    (0 0 0 0 0 0 0 0) will be the content of the register B. Then later this operation the content of the registers and flag will be similar figure given below.

  • Instruction-v:
    SUI 01H will subtract 01H from the content of the accumulator and store the result in the accumulator.
                    A-00H                0 0 0 0  0 0 0 0              

    For SUI 01H takes the 2's complement of the 01H, 2'due south Complement of 01H:

                    0 0 0 0  0 0 0 one        1 1 one 1  1 ane 1 0  (one's complement)                     + 1       ------------------        1 1 i 1  1 1 1 1        ------------------  +(00)  0 0 0 0  0 0 0 0   (Content of the accumulator)     -----------------------        1 1 one 1  1 1 1 i              

    (FFH) this volition shop in the Accumulator. Subsequently this functioning the content of the registers and flag volition be like figure given below.

    HLT will finish the execution of program.

What Happens If A Computer Has No Status Register,

Source: https://www.geeksforgeeks.org/register-content-and-flag-status-after-instructions/

Posted by: barronforkith.blogspot.com

0 Response to "What Happens If A Computer Has No Status Register"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel