1.1. Assign a 16 -bit value Write the following code in MARS Simulation. - Run this code in Debug mode, run step by step, - Stop at each instruction, observe the Registers, find: - The change of register $s0 - The change of register $pc - In Text Segment window, compare the machine code of each instruction with its instruction format 1.2. Assign a 32-bit value Write the following code in MARS Simulation. - Run this code in Debug mode, run step by step, - Stop at each instruction, observe the Registers, find: - The change of register $50- The change of register $pc - In Data Segment window, observe the value of bytes in text area - Kim tra xem cc byte u tin vng lnh trng vi ct no trong ca s Text Segment. 1.3. Tnh biu thc 2x+y= ? Write the following code in MARS Simulation. - S ng cng c g ri, Debug, chy tng lnh v dng li, - mi lnh, quan st ca s Register v ch - S thay i gi tr ca cc thanh ghi - Sau khi kt thc chng trinh, xem kt qu c ng khng? - ca s Text Segment, xem cc lnh addi v cho bit im tng ng vi hp ng v m my. T kim nghim vi khun mu ca kiu lnh I U cura so lext Segment, chuyn m my ca lnh add sang h 2 . T kim nghim vi khun mu ca kiu lnh R.1.4. Access variables on memory G chong trnh sau vo cng c MARS. Calcuate the expression Z=2X+Y with regigters on 1y Ha Nor Uowersity of Science and Technology School of Infarmation and Communication Technobgr Sau : - Bin dich v quan st cc lnh m my trong ca s Text Segment. o Lnh la urc bin dich nhur th no? - cura s Label v quan st ia ch cua X,Y,Z. So snh chng vi hng s khi bin dich lnh la thanh m my Click dp vo cc bin X,Y,Z cng cu t ng nhay t v tr cua bien X,Y,Z trong b nh ca so Data Segment. Hay boClick p vo cc bin X,Y,Z cng c t ng nhy ti v tr ca bin X,Y,Z trong b nh ca s Data Segment. Hy bo m cc gi tr ng nh cc gi tri khi to. - S dng cng c g ri, Debug, chy tng lnh v dng li, - mi lnh, quan st ca s Register v ch - S thay i gi tr ca cc thanh ghi - Xc nh vai tr ca lnh lw v sw - Ghi nh qui tc x l a tt c cc bin vo thanh ghi bng cp lnh la, Iw - X l d liu trn thanh ghi Luuu kt qu t thanh ghi tr li bin bng cp lnh la, sw - Tim hiu thm cc lnh lb, sb Assignment 1.5. Translate the following C code to MIPS. Assume that the variables i,j are assigned to registers Ss3,$s4, respectively. Assume that the base address of the arrays A and B are in registers $56 and $s7, respectively. Assume that the elements of the arrays A and B are 4 -byte words: B[8]=A[i]+A[]] Assignment 1.6. For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f,g,h,i, and j are base address of the arrays A and B are in registers $s6 and Ss7, respectively. sil St0,Ss0,2 #???? add Sto, Ss6, Sto #??? sll $St,Ss1,2 add St1, Ss7, St1 lw Ss0,0($+0) addi $St2,St0,4 lw $st0,0(S+2) add st0,St0,sss0 sw Sto, 0(S+1).