Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Translate the following code into MIPS assembly language:
1.
if(C==0){
A = B + D[12];
}else{
A = B++;
}
2.
for(I=0; I < 100; I++){
A[ I ] += A[ I ];
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a Pep/9 assembly language program that corresponds to the following C program:char ch; int main () { scanf("%c", &ch); ch--; printf("%c\n", ch); return 0; } please what is the assembly code for this?arrow_forwardThe several inaccuracies of the term "assembler language" are discussed.arrow_forwardWRITE IN HLA ASSEMBLY LANGUAGE PROGRAM 6: Three Zero GameWrite a HLA program that reads a number. Then by subtracting off a three and tens, determine if that value ends in a zero or a three. Three such numbers in a row wins the game! Shown below are sample program dialogues to help you build your program. Gimme a number: 20It ends in zero!Keep going...Gimme a number: 53It ends in three!Keep going...Gimme a number: 41Sorry Charlie! You lose the game!arrow_forward
- Please change this C code to Assembly program(x86 and ARM assembly gcc) #include <stdio.h>int main() { unsigned guess; /* current guess for prime */ unsigned factor; /* possible factor of guess */ unsigned limit; /* find primes up to this value */ printf("Find primes up to: "); scanf("%u", &limit); printf("2\n"); /* treat first two primes as special case */ printf("3\n"); guess = 5; /* initial guess */ while ( guess <= limit ) { /* look for a factor of guess */ factor = 3; while ( factor*factor < guess && guess % factor != 0 ) factor += 2;if ( guess % factor != 0 ) printf("%d\n", guess); guess += 2; /* only look at odd numbers */ }printf("Recieves a number(limit) and prints its all divisors"); for(int i = 1; i <= limit; i++) { if((limit%i) == 0){ printf("\n%d", i); } } return 0; }arrow_forwardRewrite the following in pythonarrow_forwardConvert just the following routine into PEP/9 assembly language: void adjust(int& num, int value) { if (num < 0) { num += value; } else { num -= value; } }arrow_forward
- NAND2TETRIS HARDWARE SIMULATOR HiLoMux - This has one 8-bit input bus, in, and one 4-bit output bus, out. Alsopresent is a sel input, which is used to select what appears on out. Ifsel is false, then out should contain the lower 4-bits of in (i.e. in[0],in[1], in[2], in[3]). If sel is true, then out should contain theupper 4-bits of in (i.e. in[4] mapped to out[0], in[5], mapped toout[1], etc.). In other words, the HiLoMux can be used to select anibble from a byte please use the skeleton program below CHIP HiLoMux{ IN in[8], sel; OUT out[4]; PARTS: }arrow_forwardTask 1: Convert Java code to x86 assembly Given the following code in Java: int varl int var2 0; int var3 String s = "Hello world!"; int count = 0; if (eax == ebx || eax != 5) { varl = l; var2 = 2; if (ecx >= 3) { var3 = 3; } else { var3 = 4; for (int i if(s.charAt (i) == 'l') 0; iarrow_forwardComputer Science Please answer this question in assembly language with .asm extension. The code given in 99Heater.asm file is: ; ===== Heater and Thermostst on Port 03 ==========================; ===== 99Heater.asm ==============================================; ===== Heater and Thermostst on Port 03 ========================== MOV AL,0 ; Code to turn the heater off OUT 03 ; Send code to the heater IN 03 ; Input from Port 03 AND AL,1 ; Mask off left seven bits JZ Cold ; If the result is zero, turn the heater on HALT ; Quit Cold: MOV AL,80 ; Code to turn the heater on OUT 03 ; Send code to the heater END; ================================================================= Fix the program 99Heater.asm so that the temperature will stay at 21 ºC. Please solve the question in assembly language. I will definitely give you THUMBS UP.arrow_forwardWhat precisely does it mean to be a "Assembler?"arrow_forwardTake the following program and translate it into PEP/9 assembly language: #include <iostream> using namespace std; int fib(int n) { int temp; if (n <= 0) return 0; else if (n <= 2) return 1; else { temp = fib(n – 1); return temp + fib(n-2); } } int main() { int num; cout << "Which fibonacci number? "; cin >> num; cout << fib(num) << endl; return 0; } You must use equates to access the stack and follow the call to the function as discussed in the book (pass the parameter, return address, return a value and so on). There are NO global variables in the resulting code (except a global message of "Range num? "). It must be able to do sum a range greater than 2. comments would be appreciatedarrow_forwardUsing the following C code and assembly code answer the following; C: long int nothingGreater(long int num) { if (num > 240) { return 240 - num; } else { return num; } } Assembly: 0x00000000004004ed <+0>: push %rbp 0x00000000004004ee <+1>: mov %rsp,%rbp 0x00000000004004f1 <+4>: mov %rdi,-0x8(%rbp) 0x00000000004004f5 <+8>: cmpq $0xf0,-0x8(%rbp) 0x00000000004004fd <+16>: jle 0x40050a <nothingGreater+29> 0x00000000004004ff <+18>: mov $0xf0,%eax 0x0000000000400504 <+23>: sub -0x8(%rbp),%rax 0x0000000000400508 <+27>: jmp 0x40050e <nothingGreater+33> 0x000000000040050a <+29>: mov -0x8(%rbp),%rax 0x000000000040050e <+33>: pop %rbp 0x000000000040050f <+34>: retq a. What's the starting address of nothingGreater in memory (specify in hex starting with 0x; you may omit leading zeroes)? b. What register is the argument stored in when the function starts (give the 3-letter abbreviation with a % beforehand)?arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education