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 0
.code
mov cx,8 ; loop counter
mov esi,val1 ; set index to start
mov edi,val2
clc ; clear Carry flag
top:
mov al,BYTE PTR[esi] ; get first number
sbb al,BYTE PTR[edi] ; subtract second
mov BYTE PTR[esi],al ; store the result
dec esi
dec edi
loop top
4. What will be the hexadecimal contents of RAX after the following instructions execute in
64-bit mode?
.data
multiplicand QWORD 0001020304050000h
.code
imul rax,multiplicand, 4
1)
The final value will be (5 in bx + 1 for carry+ 60h address)
bx= 0066h
2)
RAX = 0108000000003330
RDX = 0000000000000020
3)
.data
val1 QWORD 2040300 436 2047A1h
val2 QWORD 055210 304A2630B2h
result QWORD 0
. code
mov ecx, 8
mov esi , offset val1
mov edi , offset val2
mov ebx , offset result
clc
top :
mov al, BYTE PTR[esi]
sbb al, BYTE PTR[edi]
mov BYTE PTR [ebx], al
inc esi
inc edi
inc ebx
loop top
4)
RAX = 01000001020304050000
1. What will be the contents of BX after the following instructions execute? mov bx,5 stc...
37. What is the binary value of AL after the following instructions have mov al,01101011b stc rcl al,2 38. What is the binary value of AX after the following instructions have executed? mov ax, 0000000010011101b mov bx, 1010101010000000b shld ax, bx,1 39. What is the binary value of AX after the following instructions have executed? mov ax, 0000000010011101b mov bx, 1010101010001011b shrd ax, bx, 2 will be the hexadecimal values of DX and AX after the following instructions have executed?...
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]
5. Assume DS-1000, CS- 800, Ax-3412H, and BX-0200H. For the following x86 assembly code: MOV [BX +1000H], AX a) Translate the assembly code to machine code (in Hex). The opcode of MOV instruction is 100010. b) Show the values of AX, BX, and new values in memory, if there are, in the following figure c) (10 points) AFTER executing the instruction. (5 points) What is the memory address accessed by the instruction, assuming real mode operation? Show it in the...
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...