Question

In: Computer Science

Write in assembly 8086. Write a program to input nine numbers in 4*4 array and prints...

Write in assembly 8086.

Write a program to input nine numbers in 4*4 array and
prints the maximum value of
each row and then prints the minimum of each column.

Solutions

Expert Solution

Starting address of input array is 0500 and and store the result at address 0600

0400 MOV SI, 500 SI <- 500
0403 MOV DI, 600 DI <- 600
0406 MOV CL, [SI] CL <- [SI]
0408 MOV CH, 00 CH <- 00
040A INC SI SI <- SI+1
040B MOV AL, [SI] AL <- [SI]
040D DEC CX CX <- CX-1
040E INC SI SI <- SI+1
040F MOV BL, [SI] BL <- [SI]
0411 CMP AL, BL AL-BL
0413 JC 0417 Jump if carry is 1
0415 MOV AL, BL AL <- BL
0417 LOOP 040E Jump if CX not equal to 0
0419 MOV [DI], AL [DI] <- AL
041B HLT End of the program
  1. Assign value 500 in SI and 600 in DI
  2. Move the contents of [SI] in CL and increment SI by 1
  3. Assign the value 00 H to CH
  4. Move the content of [SI] in AL
  5. Decrease the value of CX by 1
  6. Increase the value of SI by 1
  7. Move the contents of [SI] in BL
  8. Compare the value of BL with AL
  9. Jump to step 11 if carry flag is set
  10. Move the contents of BL in AL
  11. Jump to step 6 until the value of CX becomes 0, and decrease CX by 1
  12. Move the contents of AL in [DI]
  13. Halt the program

Related Solutions

Write a program that initializes an array of 6 random integers and then prints 4 lines...
Write a program that initializes an array of 6 random integers and then prints 4 lines of output, containing the following: 1. Only the first and last element 2. Every element at an odd index 3. Every odd element 4. All elements in reverse order
in Java, write a program that takes an input of 4 numbers and splits them into...
in Java, write a program that takes an input of 4 numbers and splits them into 4 separate lines. EXAMPLE: so if input is 1994 the output should be 1 9 9 4
Programming in C++ Write a program that prints the values in an array and the addresses...
Programming in C++ Write a program that prints the values in an array and the addresses of the array’s elements using four different techniques, as follows: Array index notation using array name Pointer/offset notation using array name Array index notation using a pointer Pointer/offset notation using a pointer Learning Objectives In this assignment, you will: Use functions with array and pointer arguments Use indexing and offset notations to access arrays Requirements Your code must use these eight functions, using these...
Programming In C Write a program that prints the values in an array and the addresses...
Programming In C Write a program that prints the values in an array and the addresses of the array’s elements using four different techniques, as follows: Array index notation using array name Pointer/offset notation using array name Array index notation using a pointer Pointer/offset notation using a pointer Learning Objectives In this assignment, you will: Use functions with array and pointer arguments Use indexing and offset notations to access arrays Requirements Your code must use these eight functions, using these...
Assignment Description: Develop and test an Intel 8086 assembly program that reads two decimal numbers x...
Assignment Description: Develop and test an Intel 8086 assembly program that reads two decimal numbers x and y. Your program should display the result of their: 1) Addition: x+y 2) Subtraction: x-y 3) Multiplication: x*y 4) Division: x / y Notes:  x and y are two-digit decimal numbers (i.e. 0-99).  The program should display an error message if the value of y is zero, in the case of division.  You can assume only positive numbers but you...
Write an 8088/8086 assembly program that counts the length of a null terminated string that starts...
Write an 8088/8086 assembly program that counts the length of a null terminated string that starts at location STR.Assume string length will not exceed 255 character.Print the result on the screen?
Write an 8088/8086 assembly program that counts the length of a null terminated string that starts...
Write an 8088/8086 assembly program that counts the length of a null terminated string that starts at location STR.print The result on the screen Assume string length will not exceed 255 character.
Write LMC assembly code that prints the minimum of two numbers. HINT: use and extend the...
Write LMC assembly code that prints the minimum of two numbers. HINT: use and extend the table below for your solution. Mailbox Mnemonic Code Instruction description
Write a Java program that prompts the user to input a string and prints whether it...
Write a Java program that prompts the user to input a string and prints whether it is a palindrome. A palindrome is a string which reads the same backward as forward, such as Madam (disregarding punctuation and the distinction between uppercase and lowercase letters). The program must use the stack data structure. The program must include the following classes: The StackX class (or you can use the Java Stack class). The Palindrome class which must contain a method named palindrome()...
5. Write a CH program that takes the marks of a student as input and prints...
5. Write a CH program that takes the marks of a student as input and prints the grade on screen according to the following criteria: CRITERIA LESS THAN 60 GREATER THAN 60 BUT LESS THAN 65 GREATER THAN 65 BUT LESS THAN 70 GREATER THAN 70 BUT LESS THAN 75 GREATER THAN 75 BUT LESS THAN 80 GREATER THAN 80 BUT LESS THAN 85 GREATER THAN 85 BUT LESS THAN 90 GREATER THAN 90 GRADE F D D+ с C+...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT