1. What will be the value in EDX after each of the lines marked (a) and...
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;
What will be the value of the parity flag after the following lines execute? Mov al, 3 Add al, 5 What will be the value of the destination operand after each of the following instructions execute? .data var1 SBYTE -1, -2, -3, -4 var2 WORD A000h, B000h, C000h, D000h var3 SWORD -16, -42 var4 DWORD 11, 22, 33, 44 .code mov ax, var2 mov ax, [var2+4] mov ax, var3 mov ax, [var3-2]
ASSEMBLY LANGUAGE. For each problem, show the contents or setting of the requested item after executing the instructions. 1. mov eax,0 mov al,5 mov bl,11 mul bl - Show the hexadecimal digits in eax: - Show the carry flag value: - Show the overflow flag value: mov eax,0 mov edx,0 mov ax,5h mov bx,20h mul bx - Show the hexadecimal digits in eax: - Show the hexadecimal digits in edx: - Show the carry flag value: - Show the...
What is the value of AX after these five lines of code? mov AX,10 shl AX,1 add AX,10 cmp AX, 10 dec ax
Write down the value of each destination operand: .data var1 WORD 0A8B4h, 1234h, 0BA23h var2 DWORD 0E2A478C1h .code mov ax, WORD PTR [var1+3] mov eax, WORD PTR [var2+1] mov ebx, DWORD PTR [var1+2]
NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors - Irvine) that has two procedures, a main procedure and a procedure called Fib. The fib procedure is to uses a loop to calculate and printout the first N Fibonacci numbers. Fibonacci sequence is described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). The value of N is to be communicated to this...
1. What will be the contents of BX after the following instructions execute? mov bx,5 stc mov ax,60h adc bx,ax 2. Describe the output when the following code executes in 64-bit mode: .data dividend_hi QWORD 00000108h dividend_lo QWORD 33300020h divisor QWORD 00000100h .code mov rdx,dividend_hi mov rax,dividend_lo div divisor 3. The following program is supposed to subtract val2 from val1. Find and correct all logic errors (CLC clears the Carry flag): .data val1 QWORD 20403004362047A1h val2 QWORD 055210304A2630B2h result QWORD...
Write down the value of each destination operand: .data var1 WORD 3056h, 7645h, 0E347h var2 DWORD 3E56F289h .code mov ax, WORD PTR [var2+1] mov eax, DWORD PTR [var1] mov ebx, DWORD PTR [var1+3]
Each of these problems gives "before" conditions and an instruction. Give the indicated "after" state of the indicated registers and flags as appropriate. Before Instruction executed Afte (e) EDX: 00 00 02 E9 inc edx EDX SF __ ZF__ (f) EBX: FF FF FF 3B neg ebx EBX SF __ ZF__ (g) EAX: 01 23 45 67 ECX: 89 AB CD EF sub eax, ecx EAX SF __ ZF__ CF__ OF__ (h) AX: 12 34 CX: 7A BC CF: 1...
the answer is movl 8(%ebp), %edx or movl 4(%ebp), %edx? Consider the following C and assembly code: int increment(int x){ return x+1; } increment: 1 push? 2 movl 3 movl 4 addl 5 6 popl ret %ebp %esp, %ebp 8(%ebp), %eax $1, %eax %ebp Suppose we want to move the return address into register %edx on line 5. Write 1 line of assembly code to perform this action. (Write your answer with exactly 2 spaces: one after the instruction, and...