Question

6. What will be the final value in EDX after this code executes? mov edx, 1 mov eax,7FFFh cmp eax,0FFFF8000h jl L2 mov edx,0 し2: 7. (True/False): The following code will jump to the label named Target. mov eax,-30 cmp eax,-50 ig Target 8. Implement the following pseudocode in assembly language. Use short-circuit evaluation and assume that vall and X are 32-bit variables. if vall >ecx ) AND (ecx> edx) X=1 else X=2;
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hello Guys

Answer 6: EDX final value is 0.

jl means Jump less. jl instruction is a conditional jump. Jl performs a signed comparison after cmp if the destination operand is less than the source operand.

syntax: jl destination, source

mov edx,1

mov eax,7FFFh

cmp eax, 0FFF8000h    //   cmp destination, source   here destination is greater then source

jl F2 // jl work when destination is less than source but above destination is greater that why it not   work

mov edx,0    finally edx has 0 because jl is not execute

F2:

Answer 7:   True

jg stands for jump greater. it is also a conditional jump. jg instruction is a conditional jump. Jg performs a signed comparison after cmp if the destination operand is greater than the source operand.

mov eax, -30;

cmp eax,-50      //eax has -30 valve which is greater than -50. condition is true.

jg target       // jg jump on target

Answer 8:

mov vall,r1;

cmp ecx,edx   // if condition is true means ecx is greater than edx then go to lable F2

jg F2             // jump greater

mov#2,_X       // if false then set X==2

F2:cmp r1,ecx             // compare again r1 with ecx if r1 is greater then move F3

jg F3                         // jump on F3 if condition is true

mov#2,_X     // if condition false then set X==2

F3:

mov#1,_X       // Set x==1 because both condition is true

Add a comment
Know the answer?
Add Answer to:
6. What will be the final value in EDX after this code executes? mov edx, 1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • sample bubble sort code: ;---------------------------------------------------------- BubbleSort PROC USES eax ecx esi, pArray:PTR DWORD, ; pointer to...

    sample bubble sort code: ;---------------------------------------------------------- BubbleSort PROC USES eax ecx esi, pArray:PTR DWORD, ; pointer to array Count:DWORD ; array size ; ; Sort an array of 32-bit signed integers in ascending ; order, using the bubble sort algorithm. ; Receives: pointer to array, array size ; Returns: nothing ;----------------------------------------------------------- mov ecx,Count dec ecx ; decrement count by 1 L1: push ecx ; save outer loop count mov esi,pArray ; point to first value L2: mov eax,[esi] ; get array...

  • sample bubble sort code: ;---------------------------------------------------------- BubbleSort PROC USES eax ecx esi, pArray:PTR DWORD, ; pointer to...

    sample bubble sort code: ;---------------------------------------------------------- BubbleSort PROC USES eax ecx esi, pArray:PTR DWORD, ; pointer to array Count:DWORD ; array size ; ; Sort an array of 32-bit signed integers in ascending ; order, using the bubble sort algorithm. ; Receives: pointer to array, array size ; Returns: nothing ;----------------------------------------------------------- mov ecx,Count dec ecx ; decrement count by 1 L1: push ecx ; save outer loop count mov esi,pArray ; point to first value L2: mov eax,[esi] ; get array...

  • Task is to implement the following algorithms in Assembly language for x86 processor

    Task is to implement the following algorithms in Assembly language for x86 processor1) Insertion sort Demonstrate Sorted Array of 10 elements in Watch Window for each one Running time of each algorithmsample bubble sort code:;----------------------------------------------------------BubbleSort PROC USES eax ecx esi,pArray:PTR DWORD, ; pointer to arrayCount:DWORD ; array size;; Sort an array of 32-bit signed integers in ascending; order, using the bubble sort algorithm.; Receives: pointer to array, array size; Returns: nothing;-----------------------------------------------------------mov ecx,Countdec ecx ; decrement count by 1L1: push ecx ; save outer...

  • 1. What will be the value in EDX after each of the lines marked (a) and...

    1. What will be the value in EDX after each of the lines marked (a) and (b) execute? .data one WORD 8002h two WORD 4321h code mov edx,213480411h movsx edx,one (a) movsx edx,two ; (b) 2. What will be the value in EAX after the following lines execute? mov eax,1002FFFFh inc ax 3. What will be the value in EAX after the following lines execute? mov eax,30020000h dec ax 4. What will be the value in EAX after the following...

  • 1. Assume that you are given values in eax, ebx, ecx. Write an assembly code that...

    1. Assume that you are given values in eax, ebx, ecx. Write an assembly code that does the following: eax = (ecx + edx ) - (eax + ebx) 2. Write a piece of code that copies the number inside al to ch. Example: Assume that Initially eax = 0x15DBCB19. At the end of your code ecx = 0x00001900. Your code must be as efficient as possible. 3. You are given eax = 0x5. Write one line of code in...

  • X86 Assembly Language Help to implement the CipherChar Procedure at the end of the given code...

    X86 Assembly Language Help to implement the CipherChar Procedure at the end of the given code INCLUDE Irvine32.inc         .data       KeyPrompt BYTE "Enter the passphrase: ",0       TextPrompt BYTE "Enter the plaintest: ",0           str1 BYTE "The passphrase has length:",0           str2 BYTE "The plaintest has length:",0       KeyIs BYTE "The passphrase: ",0       PlainTextIs BYTE "The plaintext: ",0       CipherTextIs BYTE "The ciphertext: ",0       KMAX = 64                        ; passphrase buffer maximum size       BMAX = 128                       ; test...

  • Implement the following statements using MS430 assembly instructions. You may use more than one, ...

    Implement the following statements using MS430 assembly instructions. You may use more than one, but you should minimize the number of instructions required. You can use both native and emulated instructions. Use hex notation for all numbers 1. (a) Move the word located in register R14 to R15 (b) Increment the word in R6 by 2. (c) Perform a bitwise ANDing of the word located at address 0x0240 with the datum in R15, placing the results in R15. (d) Rotate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT