Question: Help me with Assembly language ! C language please help me ; 4. Add the value at address B to eax ; ******** write the

 Help me with Assembly language ! C language please help me; 4. Add the value at address B to eax ; ********write the code for task 4 below this line *********** ; 5.

Help me with Assembly language ! C language please help me

; 4. Add the value at address B to eax ; ******** write the code for task 4 below this line *********** ; 5. Subtract the value at address in C ; ******** write the code for task 5 below this line *********** ; 6. Call the iprintLF function to print out the value ; ******** write the code for task 6 below this line *********** ; 7. Assign the value that is in EAX to EBX (hint, think of mov) ; ******** write the code for task 7 below this line *********** ; 8. Use the right shift operator to divide the value in EAX by 2 ; ******** write the code for task & below this line *********** ; 9. The resulting value in EAX should be 21, convert 21 to a binary number (you don't need to write code to do this) ; 10. Save the value of EAX into EBX and define another variable called answer1 to the data segment and make it a byte/string definition that is initialized with The binary number for task #9 For example if the binary number is 1110100 the string would be "1110100" ; 11. Print the string using the sprintLF function (remember that you need to load the address for the string in the EAX register) ; ******** write the code for task 11 below this line *********** ; 12. Assign the value that is in EBX to EAX ; ********* write the code for task 12 below this line *********** ; 13. Use the DIV operator to divide the value in EAX by 2 (Hint: assign 2 to ECX and divide the value that is in EAX by ECX) ; ******** write the code for task 13 below this line *********** ; 14. Print the value of EAX and the value that is in EDX (Hint: use iprintLF make sure to save the value of EAX -- use an available register ; ******** write the code for task 14 below this line *********** ; 15. Write the assembly code that will perform like the following pseudocode: ; if(edx == 0) { } printf("EAX is even "); } ; else { : printf("EAX is not even "); i } ; ; /* HINT -- you will need to make 2 strings in the data segment for the print values , call them evens and odds ; Also, you will need to make sure that you save the value in EAX before you use EAX for printing */ } ; ******** write the code for task 15 below this line *********** task15: .else: ; something needs to be below this line jmp task15.end .then: ; something needs to be below this line .end: ; 16. Restore EAX by assigning it the value that was saved before the last print and divide the value in EAX by 2 again ; ******** write the code for task 16 below this line *********** ; 17. Write the assembly code that will perform like the following pseudocode: ; if(edx == 1) { i for(ECX = EAX; ECX > ; ECX--) { i print(ECX) ; } ; } ; ******** write the code for task 17 below this line *********** task17: .else: jmp task17.end .then: task17: .else: jmp task17.end .then: .Loop: .end: ; 18. Print the value of Ecx when task 17 is completed ; ******** write the code for task 18 below this line *********** ; 19. Use the OR operator to assign 6x1 in Ecx ; ******** write the code for task 19 below this line *********** ; 20. Print Ecx, it should be 1 ; ******** write the code for task 20 below this line *********** ; ******************** Output ********************** ; The output for this program should look like the following: ; ; 42 ; 21 100101 ; 21 ;0 ; EAX is even ; 10 ; 9 ;8 ; 7 ; 6 ; 5 ; 4 : 1

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!