In: Computer Science
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.
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 |