The class I'm taking is assembly programming. ***My compiler is visual studio. x86 on windows. must use masm.*** I am completely stuck. I have wrote the instructions for the program below.  ****i have attached my work please look it over and tell me how to fix errors. Instructions: Implement the following pseudocode in x86 assembly language. Use short-circuit evaluation and assume that num1 and RESULT are 32-bit variables. if ( num1 > ecx ) AND ( ecx > edx )  RESULT = 1 else    RESULT = 2; ***Title your branch label using the 1st letter of your first name and last name. For example, Ann Napa's conditional branch label would be AN: Step through your program with a debugger to see exactly what is going on as you test your program branching execution.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

The class I'm taking is assembly programming.

***My compiler is visual studio. x86 on windows. must use masm.***

I am completely stuck. I have wrote the instructions for the program below. 

****i have attached my work please look it over and tell me how to fix errors.

Instructions:

Implement the following pseudocode in x86 assembly language. Use short-circuit evaluation and assume that num1 and RESULT are 32-bit variables.

if ( num1 > ecx ) AND ( ecx > edx )

 RESULT = 1

else

   RESULT = 2;

***Title your branch label using the 1st letter of your first name and last name. For example, Ann Napa's conditional branch label would be AN: Step through your program with a debugger to see exactly what is going on as you test your program branching execution. 

Debug
x86
> Local Windows Debugger -
Auto
A Live Share
Solution Explorer 4
SeanLab4.asm
Seanlab6.asm
seanlab7.asm
;start of program
INCLUDE C:\Irvine\Irvine32.inc
8
data
jequating some constants and a variable result
org 100h
num1 equ 7
10
num2 equ 6
num3 equ 4
11
12
13
result dw e
;result will contain the final result of if-else condition
14
15
.code
16
17
18
mov cx, num2
;moving value of num2 into cx register
19
mov dx, num3
;moving value of num3 into dx register
20
21
main proc
22
;compare the value of num1 with cx register
;if cx>num1 then jump to else label
; compare the value of dx with cx register
;if cx<dx then jump to else labe1
23
cmp cx, num1
24
jnbe else
cmp cx, dx
jnae else
25
26
27
28
sp:
;if both conditions are met then 1 will be stored in result variable and bx register
29
mov result,1
30
mov bx, result
31
ret
;end of function
32
100 %
O No issues found
Ln: 38
Ch: 4
SPC
CRLF
Output
Show output from: Build
1>------ Build started: Project: week 9, Configuration: Debug Win32 ------
1>Assembling seanlab7.asm...
1>seanlab7.asm(24): error A2008: syntax error : else
1>seanlab7.asm(26): error A2008: syntax error : else
1>seanlab7. asm(28): error A2008: syntax error : sp
1>seanlab7.asm(33): fatal error A1010: unmatched block nesting
1>C:\Program Files (x86) \Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\seanlab7.obj" /W3 /errorReport:prompt
1>Done building project "week 9.vcxproj" -- FAILED.
Transcribed Image Text:Debug x86 > Local Windows Debugger - Auto A Live Share Solution Explorer 4 SeanLab4.asm Seanlab6.asm seanlab7.asm ;start of program INCLUDE C:\Irvine\Irvine32.inc 8 data jequating some constants and a variable result org 100h num1 equ 7 10 num2 equ 6 num3 equ 4 11 12 13 result dw e ;result will contain the final result of if-else condition 14 15 .code 16 17 18 mov cx, num2 ;moving value of num2 into cx register 19 mov dx, num3 ;moving value of num3 into dx register 20 21 main proc 22 ;compare the value of num1 with cx register ;if cx>num1 then jump to else label ; compare the value of dx with cx register ;if cx<dx then jump to else labe1 23 cmp cx, num1 24 jnbe else cmp cx, dx jnae else 25 26 27 28 sp: ;if both conditions are met then 1 will be stored in result variable and bx register 29 mov result,1 30 mov bx, result 31 ret ;end of function 32 100 % O No issues found Ln: 38 Ch: 4 SPC CRLF Output Show output from: Build 1>------ Build started: Project: week 9, Configuration: Debug Win32 ------ 1>Assembling seanlab7.asm... 1>seanlab7.asm(24): error A2008: syntax error : else 1>seanlab7.asm(26): error A2008: syntax error : else 1>seanlab7. asm(28): error A2008: syntax error : sp 1>seanlab7.asm(33): fatal error A1010: unmatched block nesting 1>C:\Program Files (x86) \Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\seanlab7.obj" /W3 /errorReport:prompt 1>Done building project "week 9.vcxproj" -- FAILED.
Debug
x86
• Local Windows Debugger Auto
A Live Share
Solution Explorer +
SeanLab4.asm
Seanlab6.asm
seanlab7.asm + x
17
18
mov cx, num2
;moving value of num2 into cx register
19
mov dx, num3
;moving value of num3 into dx register
20
21
main proc
22
; compare the value of num1 with cx register
;if cx>num1 then jump to else label
; compare the value of dx with cx register
;if cx<dx then jump to else labe1
23
cmp cx,num1
24
jnbe else
cmp cx, dx
jnae else
25
26
27
28
sp:
;if both conditions are met then 1 will be stored in result variable and bx register
mov result,1
mov bx, result
29
30
31
ret
;end of function
32
33
else:
;if any of condition fails then 2 will be stored in result variable
mov result,2
mov bx, result
34
35
36
ret
;end of function
37
ret
;invoking Exit
invoke ExitProcess,0
38
39
40
41
;end of main
42
main endp
43
; end of code
44
end
100 %
O No issues found
Ln: 38
Ch: 4
SPC
CRLF
Output
Show output from: Build
1>------ Build started: Project: week 9, Configuration: Debug Win32 ---
1>Assembling seanlab7.asm...
1>seanlab7.asm(24): error A2008: syntax error : else
1>seanlab7. asm(26): eror A2008: syntax error : else
1>seanlab7.asm(28): error A2008: syntax error : sp
1>seanlab7.asm(33): fatal error A1010: unmatched block nesting
1>C: \Program Files (x86) \Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\seanlab7.obj" /W3 /errorReport: prompt
1>Done building project "week 9.vcxproj" -- FAILED.
Transcribed Image Text:Debug x86 • Local Windows Debugger Auto A Live Share Solution Explorer + SeanLab4.asm Seanlab6.asm seanlab7.asm + x 17 18 mov cx, num2 ;moving value of num2 into cx register 19 mov dx, num3 ;moving value of num3 into dx register 20 21 main proc 22 ; compare the value of num1 with cx register ;if cx>num1 then jump to else label ; compare the value of dx with cx register ;if cx<dx then jump to else labe1 23 cmp cx,num1 24 jnbe else cmp cx, dx jnae else 25 26 27 28 sp: ;if both conditions are met then 1 will be stored in result variable and bx register mov result,1 mov bx, result 29 30 31 ret ;end of function 32 33 else: ;if any of condition fails then 2 will be stored in result variable mov result,2 mov bx, result 34 35 36 ret ;end of function 37 ret ;invoking Exit invoke ExitProcess,0 38 39 40 41 ;end of main 42 main endp 43 ; end of code 44 end 100 % O No issues found Ln: 38 Ch: 4 SPC CRLF Output Show output from: Build 1>------ Build started: Project: week 9, Configuration: Debug Win32 --- 1>Assembling seanlab7.asm... 1>seanlab7.asm(24): error A2008: syntax error : else 1>seanlab7. asm(26): eror A2008: syntax error : else 1>seanlab7.asm(28): error A2008: syntax error : sp 1>seanlab7.asm(33): fatal error A1010: unmatched block nesting 1>C: \Program Files (x86) \Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\seanlab7.obj" /W3 /errorReport: prompt 1>Done building project "week 9.vcxproj" -- FAILED.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY