Modify this asembly program (NASM), so that it will prompt the user to enter the
ID: 652098 • Letter: M
Question
Modify this asembly program (NASM), so that it will prompt the user to enter the size of array and print the maximum and minimum number.
For example:
Enter the size of array: 5
Enter the number: 1 12 13 45 89
The max is: 89
The min is: 1
include "io.mac" STACK 100H DATA msgi db "enter msg2 db "enter num2", 0 msg3 db "The maximum of given numbers",0 num1", 0 UDATA numl RESW 1 num2 RESW 1 CODE STARTUP Putstr msgl nwln GetInt [numl] nwln Putstr msg2 nwln GetInt [num2] mov AX, [num1] cmp AX, [num2] ig print numl nwln Putstr msg3 nwln PutInt [num2] imp done print_numl: nwln Putstr msg3 nwln PutInt [num1] done: EXITExplanation / Answer
.MODEL SMALL
.STACK 100H
.DATA
PROMPT_1 DB 'Enter the Array elements :',0DH,0AH,'$'
PROMPT_2 DB 'The Array elements are : $'
ARRAY DW 10 DUP(0)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.