Question
34. True/False the mov command can move from a memory location to another memory location directly. 35. True/False the mov command can move from a
34. True/False the mov command can move from a memory location to another memory location directly.
35. True/False the mov command can move from a register to another register directly.
; this was defined in the .data section bNum1 db 0x22 bNum2 db 0xAB bAns db 0 ; this code is in the .text section and after the _start: mov al, byte [bNum1] add al, byte [bNum2] mov byte [bAns], al
Answer: 36. Consider the above code, assume it assembles and runs What is the value of bAns after the last mov statement shown A 0xAB B 0x22 C 0xCD D 0xDC
; this was defined in the .data section bNum1 db 0x88 bNum2 db 0xAB bAns db 0
; this code is in the .text section and after the _start: mov al, byte [bNum1] add al, byte [bNum2] mov byte [bAns], al
37. Consider the above code, assume it assembles and runs What is the value of bAns after the last mov statement shown A 0x88 B 0x33 C 0xBA D 0xAB
Answer: 38. Which of the below is a valid use of the increment function A inc rax B inc al C inc qword [variable] D inc byte [variable] E All of the above
Answer: 39. True/False to use the adc (add with carry) command You first perform add in one instruction Then perform adc in the following instruction
Answer: 40. Which of these is the assembly equivalent to this C++ command? --qvar; A dec qword [qvar] B sub qword [qvar], 0x01 C xor rax, rax Inc rax sub qword[qvar], rax D All of the above E A and B but not C
Answer: 41. When using mul like this: mov rax, 0xFFFFFFFFFFFFFFFF mul 0x2
Which of the following is true A The answer will be in dx:ax B The answer will be in rdx:rax, with the most significant bits in rdx C The answer will be in rax:rdx, with the most significant bits in rax D The answer will be in rax E This is invalid syntax
Answer: 42. True/False div divides the value represented by the d and a registers such as rdx:rax or dx:ax
Answer: With respect to div in this example: mov rdx, 0x0 mov rax, 0xA mov rbx, 0x4 div rbx
43. Which of the following is true A rax contains the quotient B rbx contains the quotient C rcx contains the quotient D rdx contains the quotient E This is invalid syntax
Answer: 44. Consider the following code mov al, 0xF shr al, 0x1 What is the value in al after this code runs A 0xF B 0x8 C 0x7 D 0xE E None of the Above
Answer: 45. Consider the following code mov al, 0x5 shl al, 0x1 What is the value in al after this code runs A 0x6 B 0xA C 0xB D 0x4 E None of the Above
Answer: mov rax, 0x0 mov rcx, 0x5 startLoop: inc rax call printRCX loop startLoop call printRAX 46 Consider the code snippet above, how many times will 'call printRCX' be called? And what value will be in rax when 'call printRAX' is called? A 4, 4 B 4, 6 C 6, 4 D 5, 5 E 5, 4
Answer: 47. Consider the following code mov al, 0xF ror al, 0x1 What is the value in al after this code runs A 0xE B 0x1F C 0x87 D 0xE2 E None of the Above
Answer:
section .data extern printRAX bNumbers db 0x0, 0x1, 0x2, 0x3, 0x4, 0x5
section .text
global _start _start: mov rcx, 0x2 mov al, byte [bNumbers-1+rcx] mov ah, byte [bNumbers+1+rcx] call printRAX
48 Consider the code snippet above. What value will print when 'call printRAX' is called? A 0x0000000000000103 B 0x0000000000000301 C 0x0000000000000200 D 0x0000000000000002 E None of the above Answer:
Code snippet 1 Code snippet 2 mov rax, 0x0 mov rcx, 0x5 startLoop: inc rax Call printRCX loop startLoop call printRAX mov rax, 0x0 mov rcx, 0x5 startLoop: inc rax call printRCX dec rcx cmp rcx, 0 jg startLoop call printRAX 49 Consider the above code. True/False the code from snippet 1 will perform the same as the snippet 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started