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
6. What will be the final value in EDX after this code executes? mov edx, 1...
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 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 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 (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 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 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, 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...