Question

In: Computer Science

Write a program to find out the maximum value out of a list of ten values...

Write a program to find out the maximum value out of a list of ten values using loop. The maximum finding codes can be in a Sub Routine named MAX (optional).

easy68k assembly language

Solutions

Expert Solution

PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE

CODE-

DATA SEGMENT
         ARR DB 5,3,7,1,9,2,6,8,4       ;Define byte to stote array
         LEN DW $-ARR                      ;Define word(DW)
         MIN DB ?                                ; We are initializing Min DB ? to ? (? stands for blank value).
         MAX DB ?                              
DATA ENDS                           ;End point

CODE SEGMENT
                    ASSUME DS:DATA CS:CODE      ;assume data name given to data segment
START:
             MOV AX,DATA                  ;Move DATA to AX
             MOV DS,AX                      ;Move AX to DATA

             LEA SI,ARR Load effective address which load address of second element into the first element
             MOV AL,ARR[SI]        ; move the value of Array ARR in index of SI register to AL register.
             MOV MIN,AL               ;Mov AL register to Minimum
             MOV MAX,AL             ;Mov AL register to Maximum

             MOV CX,LEN            ;Assign value of 8 to CX (8 is length of array)
REPEAT:                   ; label and all word end with (:)
             MOV AL,ARR[SI]      
             CMP MIN,AL             ;compare for minimum
             JL CHECKMAX        ;check for max

            MOV MIN,AL            ;store min in AL
CHECKMAX:       
           CMP MAX,AL            ;comapre for max
           JG DONE

           MOV MAX,AL            ;move max value in MAX
DONE:
           INC SI                        ;Increment the address value in SI
            LOOP REPEAT        ;end of loop

            MOV AH,4CH           ;if value is 4ch then return
            INT 21H             
CODE ENDS         ;end of code segment
END START           ; end of program

Related Solutions

Must be done in C Write a C program found out the maximum value between the...
Must be done in C Write a C program found out the maximum value between the three numbers? Show steps with comments or else it will be flagged.
Write a multithreaded program that calculates various statistical values for a list of numbers. This program...
Write a multithreaded program that calculates various statistical values for a list of numbers. This program will be passed a series of numbers on the command line and will then create three separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum value, and the third will determine the minimum value. For example, suppose your program is passed the integers 90 81 78 95 79 72 85 The program will report The...
write a program to find the maximum possible sum such that no two chosen numbers are...
write a program to find the maximum possible sum such that no two chosen numbers are adjacent either vertically, horizontally, or diagonally. code in java
Write a Java program that prompts the user to enter a list of integer values and...
Write a Java program that prompts the user to enter a list of integer values and displays whether the list is sorted in increasing order or not. Here is a sample run. Note that the first number in the input indicates the number of the elements in the list. <Output> Enter list: 8 101516619111 The list is not sorted <End Output <Output> Enter list: 10 11344579 11 21 The list is already sorted <End Output Create a complete class for...
(in java) Find the maximum value and minimum value in milesTracker. Assign the maximum value to...
(in java) Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and the minimum value to minMiles. Sample output for the given program: Min miles: -10 Max miles: 40 given code below (please bold the solution, thank you!) import java.util.Scanner; public class ArraysKeyValue { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); final int NUM_ROWS = 2; final int NUM_COLS = 2; int [][] milesTracker = new int[NUM_ROWS][NUM_COLS]; int...
Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and...
Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and the minimum value to minMiles. Sample output for the given program: Min miles: -10 Max miles: 40 import java.util.Scanner; public class ArraysKeyValue { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); final int NUM_ROWS = 2; final int NUM_COLS = 2; int [][] milesTracker = new int[NUM_ROWS][NUM_COLS]; int i; int j; int maxMiles; // Assign with first element in...
write the method “getMaxValue” that finds and returns the maximum value in an integer linked list....
write the method “getMaxValue” that finds and returns the maximum value in an integer linked list. If the list is empty, then it should return 0. use the provided code below public class Question03 { public class ListNode//public for testing purposes { public int data;//public for testing purposes public ListNode link;//public for testing purposes public ListNode(int aData, ListNode aLink) { data = aData; link = aLink; } } public ListNode head;//public for testing purposes public int getMaxValue() { //----------------------------------------------------------------------------------- //Write...
4. Write a multithreaded program that calculates various statistical values for a list of numbers. This...
4. Write a multithreaded program that calculates various statistical values for a list of numbers. This program will be passed a series of numbers on the command line and will then create five separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum value, the third will determine the minimum value, fourth will determine the median value and the fifth will compute the std. deviation. For example, suppose your program is passed...
Use the given values of n=2112 and p=3/4 to find the maximum value that is significantly​...
Use the given values of n=2112 and p=3/4 to find the maximum value that is significantly​ low, muμminus−2sigmaσ​, and the minimum value that is significantly​ high, muμplus+2sigmaσ. Round your answer to the nearest hundredth unless otherwise noted.
Part1: Write a program in C/C++ to find the maximum flow in the given Flow Network...
Part1: Write a program in C/C++ to find the maximum flow in the given Flow Network using (i)Ford -Fulkerson algorithm and (ii) Edmond-Karps algorithm Go through the related text and implement each of these algorithms using the efficient data structure. Show the results of different steps of these algorithms for an instance of the flow network with total number of nodesV=6 (please note down that in a flow network there are two special nodes source and sink) and total number...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT