Explore BrainMass

Explore BrainMass

    Question about Assembly Instructions

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    1. Place binary number 3B26h in register DX and count the number of binary ones in the number in DX in register AL. For example, the binary number 3F62h has nine binary ones.

    2. Write a program that takes the smaller of two words stored in memory locations DS:1234h and DSL=:5678h and store in register AX.

    © BrainMass Inc. brainmass.com March 4, 2021, 6:16 pm ad1c9bdddf
    https://brainmass.com/computer-science/memory-management/question-assembly-instructions-38022

    Solution Preview

    Response is attached.

    Q1. PLACE BINARY NUMBER 3B26H IN REGISTER DX AND COUNT THE NUMBER OF BINARY ONES IN THE NUMBER IN DX IN REGISTER AL. FOR EXAMPLE, THE BINARY NUMBER 3F62H HAS NINE BINARY ONES.

    ANSWER :

    command comments

    MOV DX 3B26(H) ;PUT 3B26 IN DX

    MOV CX , 0000(H) ; CLEAR CX, RESULT WILL BE STORED IN
    CX

    MOV BX,0009(H) PUT 9 IN BX, NO OF ROTATIONS + 1

    LOOP: DEC BX ; DECREMENT BX

    JZ LOOP2 ; IF NUMBER OF ROTATIONS IS ...

    Solution Summary

    Assembly instructions are noted in the solution.

    $2.49

    ADVERTISEMENT