Question: . DATA minTempLimit SDWORD - 3 0 maxTempLimit SDWORD 5 0 coldLimit SDWORD 0 coolLimit SDWORD 1 5 warmLimit SDWORD 3 0 numReadings SWORD 7

.DATA minTempLimit SDWORD -30 maxTempLimit SDWORD 50 coldLimit SDWORD 0 coolLimit SDWORD 15 warmLimit SDWORD 30 numReadings SWORD 7 ; Strings titleMsg BYTE "Temperature Analysis Program", 0 progNameMsg BYTE "Programmed by [Your Name]",0 greetMsg BYTE "Hello, ",0 enterTempMsg BYTE "Please enter a temperature reading in Celsius (-30 to 50): ",0 invalidMsg BYTE "Invalid temperature! Please enter a value within the range -30 to 50.",0 resultsMsg BYTE "Temperature Analysis Results:", 0 partingMsg BYTE "Thank you for using the program, ",0 ; Variables userName BYTE 50 DUP(0) totalTemp SDWORD 0 validCount SWORD 0 coldCount SWORD 0 coolCount SWORD 0 warmCount SWORD 0 hotCount SWORD 0 minTemp SDWORD 32767 maxTemp SDWORD -32768.CODE main PROC ; Program title and programmer name call Clrscr mov edx, OFFSET titleMsg call WriteString call CrLf mov edx, OFFSET progNameMsg call WriteString call CrLf ; Get user's name mov edx, OFFSET greetMsg call WriteString mov edx, OFFSET userName call ReadString call CrLf ; Input loop for temperature readings mov cx, numReadings mov totalTemp, 0 mov validCount, 0 input_loop: mov edx, OFFSET enterTempMsg call WriteString call ReadInt ; Validate input cmp eax, minTempLimit jl invalid_input cmp eax, maxTempLimit jg invalid_input ; Valid input, process temperature add totalTemp, eax inc validCount ; Update max and min temperatures cmp eax, maxTemp jle not_new_max mov maxTemp, eax not_new_max: cmp eax, minTemp jge not_new_min mov minTemp, eax not_new_min: ; Categorize temperature cmp eax, coldLimit jl cold_category cmp eax, coolLimit jle cool_category cmp eax, warmLimit jle warm_category jmp hot_category cold_category: inc coldCount jmp next_input cool_category: inc coolCount jmp next_input warm_category: inc warmCount jmp next_input hot_category: inc hotCount jmp next_input invalid_input: mov edx, OFFSET invalidMsg call WriteString call CrLf next_input: loop input_loop ; Calculate average temperature mov eax, totalTemp cdq idiv validCount ; Display results call CrLf mov edx, OFFSET resultsMsg call WriteString call CrLf mov eax, minTemp call WriteInt call CrLf mov eax, maxTemp call WriteInt call CrLf mov eax, totalTemp call WriteInt call CrLf mov ax, coldCount call WriteInt call CrLf mov ax, coolCount call WriteInt call CrLf mov ax, warmCount call WriteInt call CrLf mov ax, hotCount call WriteInt call CrLf ; Parting message mov edx, OFFSET partingMsg call WriteString mov edx, OFFSET userName call WriteString call CrLf exit main ENDP END main. I am getting one failure and it is saying jump destination too far: by 21 bytes. How do I fix this? Please continue to use Irvine32.inc

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 Programming Questions!