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 Irvineinc
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 ifelse, ifelse ifelse 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 random signed DWORDs from to
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:
Negatives are:
C: Users console source repos Project Debug Projectexe process exited
with code
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 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 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 h
June, Julyand August: Summer color OEh
September, October and November: Fall color h
Press any key to close this window..DATA
array DWORD DUP
PROMPTSTRING BYTE ENTER NUMBER:
OUTPUTSTRING BYTE
COMMASTRING BYTE
ENDSTRING BYTE
CODE
main PROC
mov ecx,
mov eBX, OFFSET array
l:
mov edx, OFFSET PROMPTSTRING
call WriteString
call ReadInt
mov eBX eax
add eBX,
loop l
mov ecx,
mov eBX, OFFSET array
mov edx, OFFSET OUTPUTSTRING
call WriteString
l:
mov eax, eBX
call WriteDec
mov edx, OFFSET COMMASTRING
dec ecx
jz l
call WriteString
add eBX,
jmp l
l:
mov edx, OFFSET ENDSTRING
call WriteString ; Print the closing square bracket
call Crlf
mov ecx,
mov eBX, OFFSET array
mov eax,
l:
add eax, eBX
add eBX,
loop l
call WriteDec
call Crlf
exit
main ENDP
END main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
