Question: In Visual Studio 2019 only please and not advanced CSP25 Assembly Language Homework #3A (Selection) Write a program to read two numbers and print the

In Visual Studio 2019 only please and not advanced

In Visual Studio 2019 only please and not advanced CSP25 Assembly LanguageHomework #3A (Selection) Write a program to read two numbers and printthe smaller one. Example run: Enter first number: 27 Enter second number:10 Smaller = 10 Discussion: To read a number from the keyboardwe use the author's routine, ReadDec. call ; Input Num1 ReadDec num1,

CSP25 Assembly Language Homework #3A (Selection) Write a program to read two numbers and print the smaller one. Example run: Enter first number: 27 Enter second number: 10 Smaller = 10 Discussion: To read a number from the keyboard we use the author's routine, ReadDec. call ; Input Num1 ReadDec num1, EAX mov To write a number to the screen we use the author's routine WriteDEC. ; Print num1 mov EAX, num1 call Write Dec ;if boolean-expression THEN/ENDIF ; IF boolexp cmp boolexp jnBop Label1 ; True Statement ; ENDIF Labell: example IF char> '9' cmp jna char, '9' labeli ; Print "Not a valid digit" lea EDX, digGMsg call WriteString labell: ; ENDIF Note: to be successful in writing the correct code, think about how the IF is supposed to work. In this example the prin is executed if the condition is true. If it is false the jump is to the labell or the ENDIF. The JNA says to jump if the cmp does not give us an above results. ;if boolean-expressiont THEN/ELSE/ENDIF ; IF boolexp ; jnBop = cmp boolexp jump not Boolean operator jnBop Labeli ; True Statement jmp Label2 Labell: ; ELSE i False Statement ;if boolean-expressiont THEN/ELSE/ENDIF ; IF boolexp ; jnBop cmp boolexp jump not Boolean operator jnBop Labell ; True Statement jmp Label2 Labell: ; ELSE False Statement ; ENDIF Label2: example cmp jna digit, 5 labell ; IF digit > 5 i Print " digit > 5" lea EDX, digGMsg call WriteString jmp label2 labell: ; ELSE ; Print " digit is Not > 5 lea EDX, digNGMsg call WriteString label2: ; ENDIF Note: if the cmp is false we jump to labell (ELSE). If it is true then we fall into the then and jump (JMP) over the ELSE. The JMP is an unconditional jump. It is important when learning that you write code that makes sense to you. The following is another way to write the same thing. ja imp THEN ELSE following is another way to write the same thing. ja jmp THEN ELSE THEN: jmp ENDIF ELSE: ENDIF: Note: the "ja THEN" and "jmp ELSE" act the same as "jna ELSE". Solve the problem with pseudocode first. Output: Larger num Input: num1 and num2 Processing: determine which is smaller Therefore, the pseudocode would be: ; Start ; Print "Enter first number: Therefore, the pseudocode would be: 11 i Start ; Print "Enter first number: " ; Input numl ; Print "Enter second number: ; Input num2 i IF numl '9' cmp jna char, '9' labeli ; Print "Not a valid digit" lea EDX, digGMsg call WriteString labell: ; ENDIF Note: to be successful in writing the correct code, think about how the IF is supposed to work. In this example the prin is executed if the condition is true. If it is false the jump is to the labell or the ENDIF. The JNA says to jump if the cmp does not give us an above results. ;if boolean-expressiont THEN/ELSE/ENDIF ; IF boolexp ; jnBop = cmp boolexp jump not Boolean operator jnBop Labeli ; True Statement jmp Label2 Labell: ; ELSE i False Statement ;if boolean-expressiont THEN/ELSE/ENDIF ; IF boolexp ; jnBop cmp boolexp jump not Boolean operator jnBop Labell ; True Statement jmp Label2 Labell: ; ELSE False Statement ; ENDIF Label2: example cmp jna digit, 5 labell ; IF digit > 5 i Print " digit > 5" lea EDX, digGMsg call WriteString jmp label2 labell: ; ELSE ; Print " digit is Not > 5 lea EDX, digNGMsg call WriteString label2: ; ENDIF Note: if the cmp is false we jump to labell (ELSE). If it is true then we fall into the then and jump (JMP) over the ELSE. The JMP is an unconditional jump. It is important when learning that you write code that makes sense to you. The following is another way to write the same thing. ja imp THEN ELSE following is another way to write the same thing. ja jmp THEN ELSE THEN: jmp ENDIF ELSE: ENDIF: Note: the "ja THEN" and "jmp ELSE" act the same as "jna ELSE". Solve the problem with pseudocode first. Output: Larger num Input: num1 and num2 Processing: determine which is smaller Therefore, the pseudocode would be: ; Start ; Print "Enter first number: Therefore, the pseudocode would be: 11 i Start ; Print "Enter first number: " ; Input numl ; Print "Enter second number: ; Input num2 i IF numl

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!