Write an assembly program which prints the largest values among three variables. You can initialize three integers in data section (let's say 10, 45, 15).
Assembly program which prints the largest values among three variables : -
Here, we use N1,N2 & N3 for storing three variables. And, LRG for storing largest number among them.
Code:-
DATA SEGMENT
N1 DB 10H
N2 DB 45H
N3 DB 15H
LRg DB ?
ENDS
CODE SEGMENT
ASSUME DS:DATA CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV AL,N1
MOV LRG,AL
CMP AL,N2
JGE LABEL1
MOV AL,N2
MOV LRG,AL
LABEL1:
MOV AL,LRG
CMP AL,N3
JGE LABEL2
MOV AL,N3
MOV LRG,AL
LABEL2:
MOV AH,4CH
INT 21H
ENDS
END START
--------------------------------------------------------------------------------
Screenshots:
Before Execution :
After Execution :
Now , you can see LRG variable has the largest.
(I have used 8086 emulator).
------------------------------------------------------------------------------------------------------------------------------------------------------
Please give your valuable feedback and also rate my efforts.
Thank You
Write an assembly program which prints the largest values among three variables. You can initialize three...
2) Write an assembly program that is algorithmically equivalent to the following C+t code Consider the variables to be 8-bit unsigned integers; you may initialize them to any values 0-255 if you like for testing purposes 13 int speed, lower, a, b; 14 15 if (speed < 98) { 16 17 if (speed <80) t 18 lower++; 19 20 21 else f 23 24 25 26 else t 27 28 2) Write an assembly program that is algorithmically equivalent to...
Two variables named largest and smallest are assigned for you. Use these variables to store the largest and smallest of the three integer values. You must decide what other variables you will need and initialize them if appropriate. Write the rest of the program using assignment statements, if statements, or elif statements as appropriate. There are comments in the code that tell you where you should write your statements. The output statements are written for you. Execute the program. Your...
Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...
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 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 6. Write an assembly program to find the largest of twenty 32-bit values stored in ascending memory starting at "data1"....
Please code in c 1. Write a program which does the following: Declare and initialize three pointers. One points to an integer, one points to a float and one points to a character variable Ask the user to enter appropriate values for these variables. Output the values to the screen by accessing the variables directly and then by using pointer references. Print the address of each variable. Modify the variables by performing any arithmetic operation only using pointer refer- ences...
Coral 5.1. Write a program whose inputs are three integers, and whose output is the largest of the three values. Ex: If the input is 7 15 3, the output is: 15 Please provide the answer in Coral with proper line spacing/format.
Write a program that performs the following operations on a one dimensional array with 50 unsigned integers. The main program will initialize the array, print the array values to the screen and then call a function that will determine and print the maximum and minimum values. •Declare the array and any other variables. •Use a loop to initialize the array with 50 random integer values between 0 and 99 using the rand() function. (number = rand() % 100;) •Using cout...
IN C#.Develop a program that prints out the location of the largest value in a two-dimensional array. The largest values may appear more than once in the array, so you must only print out the first instance. The program defines method locateLargest() that takes a two-dimensional array of integers and returns the location (row index and column index) of the first largest value as a single-dimensional array. The program main method prompts the user to enter a 3-by-4 matrix, prints...
I need help with this MIPS program. Write a program that makes an array of integers called array in the .data section. It should print the number of zeroes in that array. You should also have a variable called array_size in the .data section which is set to the number of elements in your array. Let's say you name your program count_zeroes.s. To submit your program, you must upload it to hills and run the following command (assuming you are...
write a program which prints a sequence of integers that are multiples of 10 starting at 0 and ending at 100 in python