C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Question
help with this assembly computer science question
SAVE
AI-Generated Solution
info
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
Unlock instant AI solutions
Tap the button
to generate a solution
to generate a solution
Click the button to generate
a solution
a solution
Knowledge Booster
Similar questions
- 7. Write a program for the paper computer that will read two numbers and print the absolute value of their difference. Load it in the computer's memory and set the computer up to execute it. 01 06 11 16 Clear & add 1 IR IC Add 2 02 07 12 17 22 Subtract 3 Store Multiply Divide Read 4 5 03 08 13 18 23 6 ACC 04 09 14 19 24 Print Transfer unconditionally 8 05 10 15 20 25 Transfer on minusarrow_forwardGenerate a listing file for AddTwoSum.asm(in 3.4.3 of the text) and write a description of the machine code bytes generated for each instruction. You can write your descriptions directly over the .lst file. You might have to guess at some of the meanings of the byte values. ; AddTwoSum.asm - Chapter 3 example. .386.model flat,stdcall.stack 4096ExitProcess proto,dwExitCode:dword .datasum dword 0 .codemain proc mov eax,5 add eax,6 mov sum,eax invoke ExitProcess,0main endpend mainarrow_forwardConsider the following assembly program of the basic computer as seen in class. What would be the value of variable X after executing the following instructions? Address Assembly ORG 2FE 2FE 2FF CLE LDA X BSA rot 300 301 STA X 302 HLT Х, НЕХ ЗFА7 Y, НЕХ ЗҒАТ rot, HEX 0 CIL 303 304 305 306 307 CLE 308 CIL 309 CLE 30A BUN rot I END None of these 7D3A O 7F4E FA71arrow_forward
- Case Study Assume a computer system has a main memory of 256 Bytes. The following is a memory byte-access trace history of a program run on this system. For example, as it is shown, the program first accesses memory address 0000 0000, and then it accesses memory address 0000 0001 and so on. Note the memory addresses are represented in binary: 00000000, 00000001, 00000010, 00000011, 00001000, 00010000, 00010001, 00000100, 00000101, 00000110, 00000111, 00001001, 00001010, 00001011, 00001100, 00001000, 00001001, 00001010, 00011100, 00011101. Q3. Assume the system has a 16-Byte direct mapped unified L1 cache with a block size of 2 Bytes. The following table shows how the cache looks like after the first access to the memory is finished. Please show; in the provided table, how it looks like after the 20th access is finished. You could ignore the "Data" Column. (Add or remove Rows/Columns in the provided table for your answer, as you see fit). Cache contents after the 1st access: Cache Index…arrow_forwardIn c++ write an assembler in which it will read a program written in HACK assembly language from an external file and ultimatley translate each line of code into the binary equivalent that can be run on the computer I built so based off the following hdl files Computer below others are in the images. CHIP Computer { IN reset; PARTS: //Read-only memory (ROM) for instruction fetch ROM32K(address=PC,out=instruction); //Central Processing Unit (CPU) for instruction executionCPU(instruction=instruction,reset=reset,inM=outMemo,outM=CPUoutM,writeM=wM,addressM=adM,pc=PC); //Memory for data storage and control logic Memory(in=CPUoutM,load=wM,address=adM,out=outMemo); }arrow_forwardWrite a Java program that prompts the user for the page size used in a virtual memory system; this will be a power of two between 512 (29) and 16384 (214), inclusive. Your program should check the user input for page size to make sure it is one of the allowable inputs (must be a power of 2 and cannot be smaller than 512 or larger than 16384), and should then prompt the user for a virtual address (assume 32-bit virtual addressing, so your code must be able to accept any input between 0 and 4294967295, which is 232-1). Given this input, the program must output the virtual page number and the offset within the page. Sample output might look like this: Please enter the system page size: 1024 Please enter the virtual address: 10000 This address is in virtual page: 9 At offset: 784arrow_forward
- Return-Oriented Programming (ROP). Return-oriented programming uses sequences of instructions that arealready part of the executable program. These are called gadgets; each gadget ends with the single-byte instruction ret (binary code 0xc3). The exploit input consists of (i) enough padding to reachthe return address from the vulnerable function (can be anything), followed by (ii) a sequence ofaddresses of gadget code in the program. Each gadget executes a few instructions that do somethinguseful (e.g., move a particular value into a particular register), then “return” to the address on thetop of the stack, which starts the next gadget.ROP is important to know about because attackers can use it when countermeasures like non-executable stack make code injection infeasible. In this problem, you will search for gadgets inprograms on your VM.(Nota bene: ROP is a technique for exploiting an existing vulnerability—i.e., buffer overflow—in a program; it does not create any vulnerabilities. So…arrow_forwardTask 3: Measure the Entropy of Kernel In the virtual world, it is difficult to create randomness, i.e., software alone is hard to create random numbers. Most systems resort to the physical world to gain the randomness. Linux gains the randomness from the following physical resources: void add_keyboard_randomness(unsigned char scancode); void add_mouse_randomness(__u32 mouse_data); void add_interrupt_randomness(int irq); void add_blkdev_randomness(int major); The first two are quite straightforward to understand: the first one uses the timing between key presses; the second one uses mouse movement and interrupt timing; the third one gathers random numbers using the interrupt timing. Of course, not all interrupts are good sources of randomness. For example, the timer interrupt is not a good choice, because it is predictable. However, disk interrupts are a better measure. The last one measures the finishing time of block device requests. The randomness is measured using entropy, which is…arrow_forwardint i; float x[5], y[5]; [ lots of code deleted... ] for (i=0;i y[i]) x[i] = x[i] + y[i]; [ more code deleted... ] Translate to MIPS assembly language:arrow_forward
- analyze each program and figure out what is wrong with the memory management in the code and how to fix the code. #include <unistd.h>#include <stdio.h>#include <stdlib.h>#include <assert.h> voidmyfunction(int size) {int *p;p = malloc(size*sizeof(int));assert(p != NULL);for (int i = 0; i < size; i++) {p[i] = 1;}} intmain(int argc, char *argv[]){if (argc != 2) { fprintf(stderr, "usage: broken5 <value>\n"); exit(1); } int size = atoi(argv[1]);int counter = 0;while(1) { // the infinite while loop is NOT a bugmyfunction(size);printf("%d \t", counter);counter++;} return 0;}arrow_forward4. The Single Instruction Computer (SIC) has only one instruction that can do all operations our RISC-V does (you did a homework problem). The instruction has the following format sbn a, b, c # Mem[a]=Mem[a]- Mem[b]; if (Mem[a]- Mem[b]<0) go to PC+c For example, here is the program to copy a number from location a to location b: sbn temp, temp, 1 sbn temp, a, 1 sbn b,b, 1 sbn b, temp 1 Start: Design a single cycle datapath and control for this instruction set architecture.arrow_forwardPlease send me answer of all 1 to 5 with explanation and i will give you like sure sir pleasearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT