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 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...
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...
(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...
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...
B) Write a program to find the sum of the values ​​A5H, 69H, E2H and CCH....
B) Write a program to find the sum of the values ​​A5H, 69H, E2H and CCH. Put the result in the R2 for high byte and R4 for low byte. What is the result value expected.
(C++) Write a program that reads a list of integers from the keyboard and print out...
(C++) Write a program that reads a list of integers from the keyboard and print out the smallest number entered. For example, if user enters 0 3 -2 5 8 1, it should print out -2. The reading stops when 999 is entered.
Write a C program that creates and prints out a linked list of strings. • Define...
Write a C program that creates and prints out a linked list of strings. • Define your link structure so that every node can store a string of up to 255 characters. • Implement the function insert_dictionary_order that receives a word (of type char*) and inserts is into the right position. • Implement the print_list function that prints the list. • In the main function, prompt the user to enter strings (strings are separated by white-spaces, such as space character,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT