1.

In Assembly Language, Write The Program To Search For The Largest Number Among N Numbers Which Are Stored In The Memory?

Answer»

The program to detect the largest number among n NUMBERS stored in the memory are as follows:

Step 1>>MOV AX, 0000 

Step 2>>MOV SI, 0200 

Step 3>>MOV CX, [SI] 

Step 4>>BACK : INC SI 

Step 5>>INC SI 

Step 6>>CMP AX, [SI] 

Step 7>>JAE GO 

Step 8>>MOV AX, [SI] 

Step 9>>GO: LOOP BACK 

Step 10>>MOV [0251], AX 

Step 11>>INT 3

The program to detect the largest number among n numbers stored in the memory are as follows:

Step 1>>MOV AX, 0000 

Step 2>>MOV SI, 0200 

Step 3>>MOV CX, [SI] 

Step 4>>BACK : INC SI 

Step 5>>INC SI 

Step 6>>CMP AX, [SI] 

Step 7>>JAE GO 

Step 8>>MOV AX, [SI] 

Step 9>>GO: LOOP BACK 

Step 10>>MOV [0251], AX 

Step 11>>INT 3



Discussion

No Comment Found