Use Conditional jump
X=1;
Else
X=2;
EAX = EAX + 1 ;
Answer 1:
mov eax,op1
cmp eax,op2
jne L1
mov X,1
jmp L2
L1: mov X,2
L2:
above written code is a assembly language code of c++/java code written in first part of a question .
i hope this will help you a lot.
Answer 2:
top:cmp eax,ebx
jae next
inc eax
jmp top
next:
this is the code of second part of your question in assembly language i hope they will help u a lot.
keep rating :
best of luck
Write an assembly language code Irvine32.inc x86 for the following pseudo code. Use Conditional jump If...
Write an assembly language code for the following pseudo code i. if(op1 == op2) x=1; else x=2; using x86 assembly language
computer organization Write this code using x86 assembly language using the irvine32 library 10) In write a procedure that swaps to different values (Do NOT use the XCHG instruction). (7pts ) 10) In write a procedure that swaps to different values (Do NOT use the XCHG instruction). (7pts )
Write this code using x86 assembly language using the irvine32 library Create a procedure that fills an array of doublewords with N random integers, making sure the values fall within the range j...k, inclusive. When calling the procedure, pass a pointer to the array that will hold the data, pass N, and pass the values of j and k. Preserve all register values between calls to the procedure. Write a test program that calls the procedure twice, using different values...
Please use X86 Assembly Language, Irvine32 Declare a double word array of size 10 and initialize it with some numbers. Find the number of even numbers and the number of odd numbers in this array and save them in locations called oddCount and evenCount.
Assembly language: Before executing the following code, the value in eax was 1 What will be the value in eax after executing the following code: mov ebx, eax shl eax, 4 shl ebx, 3 add eax, ebx
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...
Assembly Language 64- bit system Description: You are responsible to implement several assembly functions to perform the simple arithmetic calculations for 2 64-bit integers. These functions will use the C function signature but the main logic within this function should be inline assembly code using the ASM block similar to the assembly example shown in class. 1. long XOR ( long op1, long op2 )- xor will return the result of bit exclusive OR of op1 / op2- can use...
This is a question from Assembly Language for x86 7th Edition by Kip Irvine, but the solution is not there. Programming exercise 12.7 #2. The code must be in assembly language for Intel using Kip Irvine library. An example of the source code would be: INCLUDE Irvine32.inc .code main PROC mov ax,4000h mov bx,1000h mov cx,1500h sub ax,bx sub ax,cx call DumpRegs exit main ENDP END main Question: Write a procedure that receives a single-precision floating-point binary value and displays...
Given the following pseudo code: int result; (result is 1 byte) int count; (count is 1 byte) for (result= 10, count= -10; count < result ; count++) { if(count > 2) result--; else result ++; } 1) write an assembly language program that will implement this pseudo code using a while construct. 2) write an assembly language program that will implement this pseudo code using a do-until construct Note: For both 1) and 2), do not forget to include the...
x86 intel assembly language instruction should be used. 3. What this pseudo-code does? And convert it into Assembly. prime( 1):#2: prime[2] :#3: {first prime number} {second prime number) candidate-5 (first candidate for a new prime number) while primeCount< 100 loop ndex:1 while (index < primeCount) and (prime[index] does not evenly divide candidate) loop add 1 to index end while if (index > primeCount) then (no existing prime evenly divides the candidate, so it is new prime) add 1 to primeCount;...