Question: can you do the imaged question like the below one done by me INCLUDE Irvine 3 2 . inc Lab Demo: Control Structures. There are

can you do the imaged question like the below one done by me
INCLUDE Irvine32.inc
Lab Demo: Control Structures. There are directives in MASM to do conditional branching, but
they're out of the scope of the course. So, we're going to make each of the three major control
structures (if, if-else, if-else if-else) using CMP and conditional and unconditional jumps.
Coding: submit all asm files to the LMS.
Printing Positives and Negatives. Copy your random number procedure from the last lab: we're
going to use it in this lab too. Create an array of 20 random signed DWORDs from -1000 to 1000.
Create two procedures: one to print the positive numbers, and one to print the negative
numbers. Each of these procedures will loop to find the values it needs. You'll need both a loop
and conditional jumping for this. Assume the array offset will be in the ESI register before your
procedure is executed, and don't forget to preserve registers! Use indirect operands for the
array addressing. Your program should give output similar to the following:
Positives are: +277+269+831+977+353+546+573+998+762+887+893+972
Negatives are: -433-3-237-280,-573-613-340-687
C: ??? Users ??? console ??? source ??? repos ??? Project1??? Debug ??? Project1.exe (process 6172) exited
with code 1.
Press any key to close this windou ...
Displaying Seasons. Create another program that will include a procedure called ShowSeason. It
will receive a register parameter for the month number (i-12) in EAx ) and based on the
following list, display a string that indicates which season that month is in. Your main procedure
must collect the month number and call the ShowSeason method. Your program should repeat
until the value 0 is entered for the month. The color combinations used in the screen snip are
included in the list, but feel free to use whichever combination you feel like!
December, January and February: Winter (color OFh)
March, April and May: Spring (color 09h)
June, Julyand August: Summer (color OEh)
September, October and November: Fall (color 06h)
Press any key to close this window..DATA
array DWORD 10 DUP(?)
PROMPT_STRING BYTE " ENTER NUMBER: ",0
OUTPUT_STRING BYTE "[",0
COMMA_STRING BYTE ",",0
END_STRING BYTE "]",0
.CODE
main PROC
mov ecx, 10
mov eBX, OFFSET array
l1:
mov edx, OFFSET PROMPT_STRING
call WriteString
call ReadInt
mov [eBX], eax
add eBX, 4
loop l1
mov ecx, 10
mov eBX, OFFSET array
mov edx, OFFSET OUTPUT_STRING
call WriteString
l2:
mov eax, [eBX]
call WriteDec
mov edx, OFFSET COMMA_STRING
dec ecx
jz l3
call WriteString
add eBX, 4
jmp l2
l3:
mov edx, OFFSET END_STRING
call WriteString ; Print the closing square bracket
call Crlf
mov ecx, 10
mov eBX, OFFSET array
mov eax, 0
l4:
add eax, [eBX]
add eBX, 4
loop l4
call WriteDec
call Crlf
exit
main ENDP
END main
 can you do the imaged question like the below one done

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!