Translate HLL statement given below to Assembly
for (j = 0; j <= 100; j = j+1)
a = a + c
Here eax register will store some value to which ecx will be added 100 times (same as doing a = a + c in HLL).
Firstly eax and ecx are initialized to some values (say 5 and 10 respectively) . Then inside the loop ecx will be added to eax 100 times using cmp.
mov eax,5
mov ecx,10
Loop:
add eax,ecx
cmp ecx,100
jle Loop
ret
Translate HLL statement given below to Assembly for (j = 0; j <= 100; j =...
Translate HLL statement if (i = = j) f = g+h; else f = g-h; to JVM assembly language
Translate the following C code to MIPS assembly. Assume that the values of a, b, i, and j are in registers $s0, $s1, $t0, and $t1, respectively. Also assume that $s2 holds the base address of the array D. for (i = 0: i < a: i++) for (j = 0: j < b: j++) D[2 * j] = i + j;
B2. Translate the following MIPS assembly instruction into machine language: lw $t8, 100($s0) B3 Write MIPS assembly code segment for the following C code snippet: for (i - O i < 10i i++) i array[i+l] - array [i8; Register assignment: i-> Şa0 Base of array -> $s0
B2. Translate the following MIPS assembly instruction into machine language: lw $t8, 100($s0) B3 Write MIPS assembly code segment for the following C code snippet: for (i - O i Şa0 Base of...
7. Translate the following C code to MIPS assembly code. Use a minimum number of instructions. Assume that the values of a,b, i and j are in registers Ss0, Ss1, St0, and St1, respectively. Also, assume that register SS2 holds the base address of the array D. for(i-0; i<a; i++) for(j=0 ; j<b; j++)
Translate the following C code to MIPS assembly code. Use a minimum number of instructions. Register allocations - i $s0 - j $s1 - base of A[] $s2 - base of B[] $s3 2) A[3] = B[i] + B[j]; 3) i = 0; while (j != A[i]) { i++; }
please translate these c++ coding to the simplest QtSPIM MIPS assembly language statement #include<iostream> using namespace std; int main() { int change; int totalCredit; cout<<"Please scan your card"; cin>>totalCredit; if(totalCredit>=3) { change=totalCredit-3; cout<<"45 min"; } else { cout<<"00"; } return 0; }
(10 points) Translate the following algorithm into assembly
language. IF 65 < X THEN X = 9+(X^2) ELSE X = - Y 3.
(10 points) Translate the following algorithm into assembly
language. X=0 FOR K = I TO 5 X=X+5 END_FOR
4. (10 points) Translate the
following algorithm into assembly language. X=0 Y=5 Z=5 WHILE Z = 5
X=X+1 Y=Y-1 Z=X+Y
2. (10 points) Translate the following algorithm into assembly language. IF65 < X THEN X = 9t(X^2) ELSE X...
IN MIPS AND MUST RUN IN QTSPIM
Translate the following C code to MIPS assembly code. Use a minimum number of instructions. Assume that the values of a, b, i and j are stored in registers Ss0, Ss1, St0 and Stl, respectively. Also assume that register Ss2 holds the base address of the array D. for (i=0; i<a; itt) for (i-0j<b:jt+)
Using beq only, not bge! Translate the following C code to MIPS assembly code. Use a minimum number of instructions. Assume that the values of a, b, i, and j are in registers $s0, $s1, $t0, and $t1, respectively. Also, assume that register $s2 holds the base address of the integer array D. Comments are required. for(i=1; i<a; i++) for(j=1; j<b; j++) D[2*j] = i + j;
Translate the following code into MIPS code. j=0; k=0; for (i = 1 ; i < 50 ; i = i + 2) { K=k+1; j = (i + j); B[k] = j; } Assume the compiler associates the variables i, j, and k to the registers $t0, $t1, and $t2 respectively. Also, assume B is an array of integers and its address is stored at register $s1. PLEASE DO NOT COPY DOWN ANOTHER SOLUTION