Homework Solution: Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the followi…

    Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the following expression: A (B)(C- D), using registers. Assign integer values to the EAX, EBX, ECX, and EDX registers. (Hint: replace A, B, C, & D with the registers EAX to EDX) A.
    Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the following expression: A = (B)(C- D), using registers. Assign integer values to the EAX, EBX, ECX, and EDX registers.

    Expert Answer

     
    MOV EBX,8; MOV ECX,9;

    Using the AddTwo program from Section 3.2 as a relation, transcribe a program that calculates the forthcoming expression: A (B)(C- D), using records. Assign integer rates to the EAX, EBX, ECX, and EDX records. (Hint: rearrange A, B, C, & D with the records EAX to EDX) A.

    Using the AddTwo program from Section 3.2 as a relation, transcribe a program that calculates the forthcoming expression: A = (B)(C- D), using records. Assign integer rates to the EAX, EBX, ECX, and EDX records.

    Expert Repartee

     

    MOV EBX,8;

    MOV ECX,9;

    MOV EDX,5;

    SUB ECX,EDX;

    ADD EBX,ECX;

    MOV EAX,EBX;

    Explanation:- The principal three educations moves integer rates to the records.

    Fourth education subtracts rate in EDX from ECX and stores consequence in ECX

    Fifth education adds rate in ECX to EBX and stores consequence in EBX

    Sixth education moves rate in EBX to EAX