in assemby, please share code and output - thanks
1. First clear all your general purpose registers by moving the value “0” into them. Initialize a variable for a BYTE, WORD, DWORD storage size each with any desired value in the data segment. Initialize another variable called Result with the size of a DWORD and make the value as an uninitialized value. In the code segment, create a label called L1 that moves the variables in the appropriate sized register and making sure NOT to overwrite them in the process. After, create another label L2 that adds all these values together and at the end of your program make sure your ECX register contains the final value. Call the DUMPREGS instruction to display your register values and move the final result into the Result variable.
2. Use the following code below as a template and follow the instructions written in the comments ;Assume I have the following data segment written: .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh ;1. Write an instruction that increments val2. ;2. Write an instruction that subtracts val3 from EAX. ;3. Write instructions that subtract val4 from val2. .code ;Write your instructions here
1. To clear the general purpose register we can move 0 .
MOV EAX,0
MOV EBX,0
MOV ECX,0
MOV EDX,0
Following image contains declaration of byte,word,DWORD and performing Addition
2. Following image contains the Increment, subtraction instruction.
Kindly comment if the image is not clearly visible.
Get Answers For Free
Most questions answered within 1 hours.