Given the Java function below, write an Assembly function called "f" and a main program that calls it. Assume that PC (program counter) initially has the address of the first instruction in the main program that you have written. private int f( int x, int y ) { if( x == 0) { return y: } else { return f( x - 1, y + 1 ); public static void main () { int x = 8; int y = 9; int z; z = f(f(4,4),9);
Q: Instruction: Please write this code in javascript and let me know if there is an issue. Questions…
A: 1. function one i. check if string length is between 8 and 12 is not return immediately…
Q: A programmer implemented a swap function in C as follows: void swap(int x, int y) { int temp;…
A:
Q: The following question is related to C programming system call Task-2: Write a program that…
A: Coded using C language. Algorithm: First, we define two pid_t variables to hold the process IDs…
Q: 31. Write an assembly language program that corresponds to the following C program: int mum; int…
A: Given: Goal: We have to write an assembly language program for the above-given C code.
Q: Write this in 8-bit or 16-bit assembly simulator: A simple homework (for a grade up to 8) can be: •…
A: Pac-Man is a classic arcade game released in 1980 by Namco. The game features a character named…
Q: Write a C program that creates a security access code from a social security number entered by a…
A: // stdio.h is the C standard library it is a header file stdio.h which stands for standard…
Q: n and write a C program that performs the following functionality: 1. Read your student number on…
A: CODE #include <stdio.h> // for argv for command line argument int main(int argc, char…
Q: Find the errors in the following C program and fix them. You may directly mark the error and fix it…
A: Given code contains some error which need to be fixed for proper execution of the code.
Q: Implement the following C program into assembly language and comment assembly program. Assume $t1 is…
A: As I can see, the program is even or odd program implemented in c. Below I am converting this…
Q: Java question: Please use words to describe exactly how the computer process doSomething(3) public…
A: Complete Code Should Be like this import java.util.*;class abc { static void doSomething(int n){…
Q: Implement a subprogram which takes 4 numbers in the argument registers $a0...$a3, and returns the…
A: Implement a subprogram which takes 4 numbers in the argument registers $a0...$a3, andreturns the…
Q: What exactly do you mean by "execution flow"?
A: A set of instructions known as a programming language enables a computer to carry out particular…
Q: Assignment for Computer Architecture Instructions: The assignment is to create a program that adds…
A: Below is the complete solution with explanation in detail for the given question in Java Programming…
Q: Write the mnemonics of the following program: The pressure of two boilers is monitored and…
A:
Q: change to ada language import java.util.scanner; public class problem41 { public static void…
A: Program in Java: #include <stdio.h> int main() { int positives = 0; // Count the…
Q: Consider the C code given below: volatile static int sum = 0 for (int i=0; i<8; i++) { if (i<4) sum…
A: #include <stdio.h> int main(){ volatile static int sum =0; for(int i=0;i<8;i++)…
Q: Read your student number on the command line when you call the program executab Example: testq1.exe…
A: It is defined as the mother language of all the modern programming languages because most of the…
Q: Develop a Java program using NetBeans. Your program should initially display a menu to the user. The…
A: import java.lang.reflect.Field; import java.lang.reflect.Constructor; import…
Q: Write the code in python programming for the below problem. Introduction One useful data point in…
A: Q: Code the given problem
Q: Explain what you mean by "execution flow."
A: The "execution flow" is a term used in computer science to describe the sequence in which…
Q: The Problem Input File 55 67 gC programming language write a program that simulates a variant of the…
A: ANSWER:-
Q: Translate the following C program to Pep/9 assembly language. #include int inpNum, sum, count, min;…
A: Solution : ? Input a number: 3? Input a number: 5? Input a number: 7? Input a number: 9? Input a…
Q: What is the best way to respond to a denial of service assault in light of the recent cyber security…
A: Introduction: DoS attacks are becoming more common, which is a big problem for cyber security in…
Q: Given the following code, show step by step and explain how variables are created and eliminated in…
A: 1) Main is executed so, variable a and c with values 3 and 4 are created in RAM memory. 2) After…
Q: Implement a subprogram which takes 4 numbers in the argument registers $a0...$a3, and returns the…
A: Implement a subprogram which takes 4 numbers in the argument registers $a0...$a3, andreturns the…
Q: Professor Santos has decided to hide a secret formula for a new type of biofuel. She has, however,…
A: To take the input until user enters 99999, we have to use while loop. We will create an empty list…
Q: What do you mean by execution flow?
A: Execution flow is used for decision making in programming languages.
Q: Note: assembly language(8086 microprocessor) Write a program that takes a number N (2 digit…
A: MICROPROSEEROR CODE Assembly code: sort:push rbpmov rbp, rspmov QWORD PTR [rbp-24], rdimov DWORD PTR…
Q: Design and write a C program that performs the following functionality: 1. Read your student number…
A: CODE #include <stdio.h> // for argv for command line argument int main(int argc, char…
Step by step
Solved in 2 steps
- Don't reject if you did not have knowledge. Assembly language. On sim8085 simulatorDesign and write a C program that performs the following functionality: 1. Read your student number on the command line when you call the program executable. Example: testq 1.exe 201314493 2. Check if sufficient number of input arguments have been entered. 3. If insufficient number of input arguments have been entered, write an error message and exit the program by returning minus (negative) one (-1); 4. Copy the student number into a string array and determine its length. 5. Prompt the user for their first and last name. Store these values. 6. Loop through each number in the student number and determine if the digit is even or odd. For example, in the above example, the first and second digits are even (20), and the third and fourth digits are odd (13). 7. If the number is even, then convert the number to the next odd number. For example, if the number is 2, then add one to the number to make it an odd number, 2+1 = 3. 8. Hint: check the remainder to determine if a number is even (0)…Please translate the following c program below to a pep/9 assembly language and please Also explain the code.
- Design and write a C program that performs the following functionality: 1. Read your student number on the command line when you call the program executable. Example: testq1.exe 201314493 2. Check if sufficient number of input arguments have been entered. 3. If insufficient number of input arguments have been entered, write an error message and exit the program by returning minus (negative) one (-1); 4. Copy the student number into a string array and determine its length. 5. Prompt the user for their first and last name. Store these values. 6. Loop through each number in the student number and determine if the digit is even or odd. For example, in the above example, the first and second digits are even (20), and the third and fourth digits are odd (13). 7. If the number is even, then convert the number to the next odd number. For example, if the number is 2, then add one to the number to make it an odd number, 2+1 = 3. 8. Hint: check the remainder to determine if a number is even (0)…Design and write a C program that performs the following functionality:1. Read your student number on the command line when you call the program executable.Example: testq1.exe 2013144932. Check if sufficient number of input arguments have been entered.3. If insufficient number of input arguments have been entered, write an error message andexit the program by returning minus (negative) one (-1);4. Copy the student number into a string array and determine its length.5. Prompt the user for their first and last name. Store these values.6. Loop through each number in the student number and determine if the digit is even or odd.For example, in the above example, the first and second digits are even (20), and the thirdand fourth digits are odd (13).7. If the number is even, then convert the number to the next odd number. For example, if thenumber is 2, then add one to the number to make it an odd number, 2+1 = 3.8. Hint: check the remainder to determine if a number is even (0) or odd (1)9.…Write the mnemonics of the following program: The pressure of two boilers is monitored and controlled by a microcomputer works based on microprocessor programming. A set of 6 readings of first boiler, recorded by six pressure sensors, which are stored in the memory location starting from 2050H. A corresponding set of 6 reading from the second boiler is stored at the memory location starting from 2060H. Each reading from the first set is expected to be higher than the corresponding position in the second set of readings. Write an 8085 sequence to check whether the first set of reading is higher than the second one or not. If all the readings of first set is higher than the second set, store 00 in the ‘D’ register. If any one of the readings is lower than the corresponding reading of second set, stop the process and store FF in the register ‘D’. Data (H): First set: 78, 89, 6A, 80, 90, 85 Second Set:71, 78, 65, 89, 56, 75
- Implement a subprogram which takes 4 numbers in the argument registers $a0...$a3, andreturns the largest value and the average in $v0 and $v1 to the calling program. Theprogram must be structured as follows:Subprogram largestAndAverage($a1, $a2, $a3, $a4){ int var0 = $a0, var1 = $a1, var2 = $a2, var3 = $a3; $s0 = getLarger($a1, $a2); $s0 = getLarger($s0, $a3); $v0 = getLarager(s0, $a4); // Largest is in $v0 $v1 = (var0 + var1 + var2 + var3)/ 4; // Aversge is in $v1 return;}Subprogram getLarger($a0, $a1) { $v0 = $a0 if ($a1 > $a0) $v0 = $a1 return;}Take note of how var0...var3 are used. The values of $a0 and $a1 (at least) must be placed on the stack because they are not immediately available when needed to calculate the average because they are modified during the call to getLarger. You must use the getLarger subprogram displayed above to calculate the greatest value for this problem, and it must be called before the average calculation. This indicates that at the very least $a0…Implement a subprogram which takes 4 numbers in the argument registers $a0...$a3, andreturns the largest value and the average in $v0 and $v1 to the calling program. Theprogram must be structured as follows:Subprogram largestAndAverage($a1, $a2, $a3, $a4){ int var0 = $a0, var1 = $a1, var2 = $a2, var3 = $a3; $s0 = getLarger($a1, $a2); $s0 = getLarger($s0, $a3); $v0 = getLarager(s0, $a4); // Largest is in $v0 $v1 = (var0 + var1 + var2 + var3)/ 4; // Aversge is in $v1 return;}Subprogram getLarger($a0, $a1) { $v0 = $a0 if ($a1 > $a0) $v0 = $a1 return;}Note the use of the variables var0...var3. Because the values of $a0 and $a1 (at least) arechanged on the call to getLarger, they will not be available when they are needed to calculatethe average, and must be stored on the stack. To do this problem correctly, you mustcalculate the maximum value using the getLarger subprogram shown here, and it must becalled before the average is calculated. This implies that at a minimum $a0 and $a1 must…In python, Problem DescriptionProfessor Santos has decided to hide a secret formula for a new type of biofuel. She has, however, left a sequence of coded instructions for her assistant. Each instruction is a sequence of five digits which represents a direction to turn and the number of steps to take. The first two digits represent the direction to turn: • If their sum is odd, then the direction to turn is left.• If their sum is even and not zero, then the direction to turn is right.• If their sum is zero, then the direction to turn is the same as the previous instruction. The remaining three digits represent the number of steps to take which will always be at least 100. Your job is to decode the instructions so the assistant can use them to find the secret formula. Input SpecificationThere will be at least two lines of input. Each line except the last line will contain exactly five digits representing an instruction. The first line will not begin with 00. The last line will contain…
- change to ada language import java.util.scanner; public class problem41 { public static void main(string[] args) { scanner input = new scanner(system.in); int positives = 0; // count the number of positive numbers int negatives = 0; // count the number of negative numbers int count = 0; // count all numbers double total = 0; // accumulate a totol // promopt the user to enter an integer or 0 to exit system.out.print("enter an integer, the input ends if it is 0: "); int number = input.nextint(); if (number == 0) { // test for sentinel value system.out.println("no numbers are entered except 0"); system.exit(1); } while (number != 0) {// test for sentinel value if (number > 0) { positives++; // increase positives } else { negatives++; // increase negatives } total += number; // accumulate total count++; // increase the count number = input.nextint();//read the next number } // calculate the average double average = total / count; // display results system.out.println( "the number of…Example: The Problem Input File Using C programming language write a program that simulates a variant of the Tiny Machine Architecture. In this implementation memory (RAM) is split into Instruction Memory (IM) and Data Memory (DM). Your code must implement the basic instruction set architecture (ISA) of the Tiny Machine Architecture: //IN 5 //OUT 7 //STORE O //IN 5 //OUT 7 //STORE 1 //LOAD O //SUB 1 55 67 30 55 67 1 LOAD 2- ADD 3> STORE 4> SUB 5> IN 6> OUT 7> END 8> JMP 9> SKIPZ 31 10 41 30 //STORE O 67 //OUT 7 11 /LOAD 1 //OUT 7 //END 67 70 Output Specifications Each piece of the architecture must be accurately represented in your code (Instruction Register, Program Counter, Memory Address Registers, Instruction Memory, Data Memory, Memory Data Registers, and Accumulator). Data Memory will be represented by an integer array. Your Program Counter will begin pointing to the first instruction of the program. Your simulator should provide output according to the input file. Along with…The following question is related to C programming system call Task-2: Write a program that will create a child and another grandchild process. Every process will print a line. The parent process will print, “I am parent” Child process will print, “I am child” The grandchild process will print, “I am grandchild” Now, write the program in such a way that the following output will be shown - I am grandchild I am child I am parent