Homework Solution: Use the following program for this question. Assume the .data section starts at 0 times 10010000 and the .text sta…

    Use the following program for this question. Assume the .data section starts at 0x10010000 and the .text starts at 0x00400010, Notice for this problem the starting PC will NOT be the default value so if you just type the code into the assemble, your answers may not be correct. 1. data num: .word 7 globl .text main: main lui $t0, 0x1001 top: beg $s0, $0, end jal func add $s0, $s0, $t0 addi $s0, Şs0, -1 top bne $S0, $0, top end: func: sll $v0, $t1, 4 Şra r a. There are five labels in the code. What is the value of each label? b. What is the addressing mode for each instruction? There are 10 unique instructions c. Encode the program and give the machine code in hex. Be careful with the branch and jump instructions
    Use the following program for this question. Assume the .data section starts at 0 times 10010000 and the .text starts at 0 times 00400010, Notice for this problem the starting PC will NOT be the default value so if you just type the code into the assemble, your answers may not be correct. .data num: .word 7 .globl main .text main: lui $t0, 0 times 1001 top: lw $t1, 0 ($t0) beg $s0, $0, end jal func add $s0, $s0, $t0 addi $s0, $0, -1 j top bne $S0, $0, top end: func: sll $v0, $t1, 4 jr $ra a. There are five labels in the code. What is the value of each label? b. What is the addressing mode for each instruction? There are 10 unique instructions. c. Encode the program and give the machine code in hex. Be careful with the branch and jump instructions.

    Expert Answer

     
    a. The five lables of the code are following 1. Data 7

    Use the subjoined program coercion this doubt. Assume the .basis individuality starts at 0x10010000 and the .extract starts at 0x00400010, Referableice coercion this completion the starting PC conquer NOT be the omission prize so if you reasonable archearchekind the jurisdiction into the convoke, your rejoinders may referable be set-right. 1. basis num: .account 7 globl .extract main: main lui $t0, 0x1001 culmination: crave $s0, $0, purpose jal func appobject $s0, $s0, $t0 appendi $s0, Şs0, -1 culmination bne $S0, $0, culmination purpose: func: sll $v0, $t1, 4 Şra r a. There are five delineates in the jurisdiction. What is the prize of each delineate? b. What is the appendressing command coercion each direction? There are 10 uncommon directions c. Enjurisdiction the program and impart the muniment jurisdiction in hex. Be attentive with the member and bounce directions

    Use the subjoined program coercion this doubt. Assume the .basis individuality starts at 0 times 10010000 and the .extract starts at 0 times 00400010, Referableice coercion this completion the starting PC conquer NOT be the omission prize so if you reasonable archearchekind the jurisdiction into the convoke, your rejoinders may referable be set-right. .basis num: .account 7 .globl main .extract main: lui $t0, 0 times 1001 culmination: lw $t1, 0 ($t0) crave $s0, $0, purpose jal func appobject $s0, $s0, $t0 appendi $s0, $0, -1 j culmination bne $S0, $0, culmination purpose: func: sll $v0, $t1, 4 jr $ra a. There are five delineates in the jurisdiction. What is the prize of each delineate? b. What is the appendressing command coercion each direction? There are 10 uncommon directions. c. Enjurisdiction the program and impart the muniment jurisdiction in hex. Be attentive with the member and bounce directions.

    Expert Rejoinder

     

    a. The five lables of the jurisdiction are subjoined

    1. Basis 7

    2. Global Main

    3. Main

    4. Culmination

    5. Function

    b. The three basic commands of appendressing are −

    1. Register appendressing

    2. Immediate appendressing

    3. Memory appendressing

    1. PDP-8

    2. PDP-10

    3. PDP 11

    4. VAX Directions

    5. Pentium Direction Coercionmat

    6. ARM Direction Coercionmats

    7. Thumb Direction Set