Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in BL. Bits 6-7 in BL should be cleared, and AL should be unchanged
Mov al, bl
And 00111111, bl
Write a sequence of two instructions that copies the integer in bits 4-7 from AL register into bits 0-3 of the BL register. Upper 4 bits of AL and BL will be cleared
Shr al, 4
Mov bl, al
Code instructions that jump to the label L1 when either bit 2 or 3 is set in DL register
Test dl, 00001100
Jnz L1
L1
Write instructions that implement following pseudo code by conditional jump.
If (eax>ecx)
Mov dl, +7
Else
Mov dl, -2
Cmp eax, ecx
Jg L1
Mov dl, -2
Jmp L2
L1:
Mov dl, 7
What will be final values of xc and dx when following code executes
.data
Array SWORD 4,-2,5,8,-3,7,1,0
.code
Mov cx,1
Mov esi,2
Mov ax,array[esi]
Mov bx,array[esi+4]
Cmp ax, 3
Jae L2
Cmp bx,4
Jb L1
Jmp L3
L1: mov xc,4
L2: mov dx,5
Jmp L4
L3: mov dx,6
Cx = 1
Dx =5
What is the decimal representation of ollowing binary number?
1010011.101
83.625
In the following code sequence, show the value of AL after each shift or rotate instruction
Mov al, 8Ch
Sar al,1
8C: 10001100
Sar 1: 11000110 (C6)
Mov al, 6Bh
Ror al,1
6B: 01101011
Ror 1: 10110101 (B5)
Stc
Mov al, 0D4h
Rcl al,1
D4: 11010100
Rcl: 10101001 (A9)
Please indicate whether each statement is T or F
Test instruction always alters destination operand: F
JBE instruction is used when comparing unsigned integers: T
JECXZ instruction jumps to target label when the CX register is equal to zero: F
OR instruction canbe used to find intersection of two bit mapped sets: F
Following code will jump to label named Target: T
Mov eax, -72
Cmp eax, 30
Ja Target
Suppose in a system the datae field packs the year,month, and day into 16 bits as following
DH DL
00100110 01101010
Year: bits 9-15
Month bits 5-8
Day bits 0-4
A) Write a code to extract day field from register DX and save it in day label
Mov al,dl
And dl, 0001111
Mov day,al
B) Write code to extract month field from DX and save it in month label
Mov ax, dx
Shr ax, 5
And 00001111h, ax
Mov month, al
Which statement is true about what will happne when the example code runs, draw the stack frame and explain the reason.
1: main PROC
2: push 10
3: push 20
4: call Ex2sub5: pop eax
6: INVOKE ExitProcess,0
7: main ENDP
9: EX2Sub PROC
10: popeax
11: ret
12:
Write a program that jumps to a label if any of the bits 0,1,7 are set in AL, without changing the value
Test al, 10000011
Jnz L1
In the following instruction sequence, show resulting value of AL where indicated in hexadecimal
Mov al, 3Dh
And al,74h
3D: 00111101
74: 01110100
AL=00110100 (34h)
Mov al,9Bh
Or al, 35h
9B:10011011
35:00110101
AL=10111111 (BFh)
Implement the following pseudocode in assembly.
If (val1>ecx) AND (ecx>edx)
X=1
Else
X=2
Cmp val1,ecx
Jna fail
Cmp ecx,edx
Jna fail
Mov x,1
jmp L2
Fail: mov x,2
L2
What will be the final value in EDX after code executes?
Mov edx,1
Mov eax,7FFFh
Cmp eax,8000h
Jl L1
Mov edx,0
L1
Edx = 0
Use following variable definitions for following question
.data
Var1 SBYTE -4,-2,3,1
Var2 WORD 1000h, 2000h, 3000h, 4000h
Var 3 SWORD -16,-42
What will be hex value of destination operand after each of following instructions execute in sequence?
Mov al, var1
-4 (FCh)
Mov ah,[var1+3]
Movsx ebx,var1
I assume that a brief explanation is asked in the questions. and I have answered some parts.
but it should be clearly mentioned in question what is required
Get Answers For Free
Most questions answered within 1 hours.