Question:
Write an assembly program to find the largest of twenty 32-bit values stored in ascending memory starting at "data1". Store the largest data element found at "largest", and store the address of the largest data found at "largest address" .text .global main .equ data1, 0x40000000 .equ largest, Ox40001000 .equ largestaddress, 0x40001000 LDR RO, -data1 LDR R1,=largest LDR R2, largestaddress
Answer:
Step 1: Write a Assembly Code to store twenty (20) 32 bit values from Address 4050
Step 2: First main thing is that 20 32-bit values are stored in ascending memory starting at "data1"
Step 3: Store the first element of the array to 'A'
Step 4: Comparing A with other elements of array, If A is smaller then stored the element in A, otherwise compare with next element.
Below is the data-segment
text
.global main
.equ data1, 0x40000000
.equ largest, Ox40001000
.equ largestaddress, 0x40001000 LDR RO, -data1 LDR R1,=largest LDR R2, largestaddress
Step 5: Value of A is the Answer
As per above steps below is the assembly code
==============================================================================.
Memory Address Instructions Comments
4000 LXI H,4050 H <-40,L <-50
4003 MOV C,M C <-M
4004 DCR C C <- C-1
4005 INX H HL <- HL+0001
4006 MOV A,M A<- M
4007 INX H HL <- HL+0001
4008 CMP M A-M
4009 JNC 400D If Carry Flag=0, goto 400D
400C MOV A,M A <-- M
400D DCR C C<-- C-1
400E JNZ 4007 If Zero Flag=0, goto 4007
4011 STA 3050 Store A Value to Address 3050
4014 HLT Stop the Program
==============================================================================
Write Compile and execute the program in x85/x86 compatible operating systems.
Give different input variables for 20 32bit numbers are verify the output of largest number within those 20 numbers.
For Example 20 Input numbers are
1 3 4 5 6 8 7 9 11 14 15 17 19 21 23 27 30 34 67 70
Above Input is stored from 4050 onwards
Now Ran the above Assembly code and the largest number is 70 Stored in Address 3050
6. Write an assembly program to find the largest of twenty 32-bit values stored in ascending memory starting at "data1". Store the largest data element found at "largest", and store t...
Write a program to add the 32-bit numbers stored at data memory locations 0x200~0x203 and 0x204~0x207, respectively, and store the sum at 0x208~0x20B.
Please answer 2.6.1 2.6 The table below shows 32-bit values of an array stored in memory Address Data 24 38 2 4 32 36 40 2.6.1 [5] <COD §§22, 2.3-For the memory locations in the table above, write C code to sort the data from lowest to highest, placing the lowest value in the smallest memory location shown in the figure. Assume that the data shown represents the C variable called Array, which is an array of type int, and...
Figure below shows part of the byte-addressable program memory that uses big-endien format to store data. The memory contains a 32-bit RISC-V instruction at address 0x00408000. Each memory address stores one byte. Derive the exact instruction code stored at address 0x04080000 in the program memory and explain what the assembly instruction does. 7 0 Ox11 0x93 Ox1D Address Ox00408004 Ox00408003 0x00408002 0x00408001 0x00408000 Ox00407FFF Ox00407FFE Ox00407FFD Ox00407FFC Ox87 Ox00 Ox00 Oxld Ox93 Ox01
Please answer the list questions above with explanation. Thank you LOAD-STORE PROGRAM EXAMPLE Write an Assembly program to add two 8-bit numbers. C A+B lds r16, A lds rl7, B : 1. Load variables add E16, :172 Do something 2. Do something sts C, r16 : 3. Store answer Identify the operation, source operand, destination operand in the first Data Transfer insiruction. Identify the source/destination operand in the Arithmetic and Logic (ALU) instruction. .What addressing mode is used by the...
T F Xilinx's SDK assembler supports both FOR statements, but not wHILE statements T F In the ARM processor, immediate operands are stored in data memory, and not in the opcode T F In ARM processor instructions, one but not both operands can come from main T F In the ARM processor, a single load/store instruction T F It is possible for a microprocessor to use a virtual TCache memory is typically much faster and much larger than main memory...
Write a program in MIPS assembly language that implements the DESCENDING bubble sort algorithm to sort a variable-sized array of signed 32-bit integers (words)that are read from the console. Be reminded that in a descending sort, the integers are sorted from the largest to the smallest. A “special value” 99999 will beused to signify the end of the input sequence. This value is not to be considered part of the input data set. However, any value greater than 99999 that...
Assembly language 64 bit please ! An example file for set up ==========+ ;| Data Segment BEGINS Here | ;+======================================================================+ segment .data ;Code this expression: sum = num1+num2 num1 dq 0 ;left operand of the addition operation num2 dq 0 ;right operand of the addition operation sum dq 0 ;will hold the computed Sum value RetVal dq 0 ;Integer value RETURNED by function calls ;can be ignored or used as determined by the programmer ;Message string prompting for the keyboard...
i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how...
This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...