Convert the following pep/9 machine language program into an
assembly code. Determine the output of this program if the input is
‘tab’. The left column is the memory address of the first byte on
the line:
0000 D1FC15
0003 F1001F
0006 D1FC15
0009 F10020
000C D1FC15
000F F10021
0012 D10020
0015 F1FC16
0018 D1001F
001B F1FC16
001E 00
convert following C++ code into MIPS assembly:
int main()
{
int x[10], occur, count = 0;
cout << "Type in array numbers:" << endl;
for (int i=0; i<10; i++) // reading
in integers
{
cin >>
x[i];
}
cout << "Type in occurrence
value:" << endl;
cin >> occur;
// Finding and printing out occurrence indexes in the array
cout << "Occurrences indices are:" <<...
I have below code! I would like to to convert the larger
variable to hex and get len() of larger once it's in hex
format.
Example: if larger number is 900000 then the hex is DBBA0 then
len of DBBA0 is 5. I need everything save in new variable!
It's in C.
// Function to find largest element
int largest(int a[], int n)
{
int large = a[0], i;
for(i = 1; i < n; i++)
{
if(large <
a[i])...
Please convert the following C program into the RISC-V assembly
code
1)
#include <stdio.h>
int main()
{
int i = 2, j = 2 + i, k;
k = i * j;
printf("%d\n", k + j);
return 0;
}
2)
#include <stdio.h>
int main()
{
int i = 2, j = 2 + i, k = j / 2;
if (k == 1)
{
printf("%d\n", j)
k = k * 2;
if ( k == j)
{
printf("%d\n|, j);
}...
a. Write machine code for the following assembly code.
Assume that the segment is placed starting at location 80000. Use
decimal numbers to represent each instruction.
loop: beq
$s3, $s1, endwhile
add $t0, $s3, $s4
lw
$t1, 0($t0)
add $s0, $s0, $t1
addi
$s3, $s3, 4
j loop
endwhile:
b. Write assembly code for the following machine code.
Assume that the segment is placed starting at location 80000.
Create labels for jump and branch instructions. Indicate the actual...
Convert the following text into a code
format:
The program reads an unspecified
number of integers until a zero is entered. While the program reads
each number it counts the number of positive numbers and the number
of negative numbers that have been entered and sum up the values of
the numbers entered. After the user enters zero, the program
computes the average of the input values, not counting the zero. At
the end, the program displays the average, and...