Examine the execution of a program

Assignment Help Assembly Language
Reference no: EM132304522

1. True/False The Von Neumann Architecture enabled the first general-purpose computers by abstracting the code from the hardware.

2. True/False There are 14 General purpose Registers in the Intel Architecture.

3. What word is spelled by the following ASCII Codes (Chart on last page)
0x41 0x70 0x70 0x6C 0x65

A. Frogs
B. Apart
C. Apple
D. Chart

4. In order to convert an Upper Case Letter to a Lower Case Letter you can

A. Add 32 (decimal)
B. Add 0x20 (Hex)
C. Subtract 0x20 (Hex)
D. Subtract 32 (decimal)
E. Both A and B

5. True/False The Ones complement of a binary value is equivalent to the not of the value
In other words you can find the one's compliment of a binary number by applying a not operation.
Example: 0110 is both the ones compliment of and the NOT of 1001.

6. What is the Two's Compliment of the binary value
1010 0101

A. 0101 1010
B. 0101 1011
C. 1010 0110
D. 1010 0101

7. NaN stands for
A. Not aNother
B. Not a Number
C. Never sAy Never
D. A side dish often served in Indian Cuisine

8. Which of the following is NOT a section in a properly formatted Assembly program?
A. BSS
B. Data
C. Code
D. Text

9. What will the second line of code in this program snippet do?
Assume the code will assemble and run without error
movrax, 1
;movrdx, rax
mulrdx
movrdx, rax

A. Multiply an unknown value in rdxtimesrax
B. Move the value 1 into rax
C. Move the value of rax into rdx
D. None of the above

10. What is the proper order of operation for these operations, performed by the Loader, Linker and Assembler?
A. Link, Assemble, Load
B. Load, Assemble, Link
C. Assemble, Link, Load
D. Load, Link Assemble

11. A debugger allows the user to control and examine the execution of a program including the ability to:
A. Examine the values of memory
B. Examine the values in the Stack
C. Examine the values in the Registers
D. All of the above
E. A and C only

12. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xff
A. 0xff
B. It is unknown what values will be stored prior to ff
C. This is not a valid operation
D. 0xff00000000000000

13. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rbx, 0x2
mov rdx, 0x0
mul rbx

A. 0x10
B. The previous value of rax shifted right by one
C. The previous value of rax multiplied by 2
D. It is unknown based on the information given
E. B, C and D are all correct

14. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov al, 0xff
add al, 0xf
adc ah, 0x0

A. 0x100
B. 0xe
C. 0x10e
D. 0x10f

15. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error

movrax, 0xff
movrbx, 0x0f
subrax, rbx

A. 0xf0
B. 0x0f
C. 0xff
D. 0x00

16. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0x10
xor rdx, rdx
mov rbx, 0x4
div rbx

A. 0x4
B. 0x2
C. 0x25
D. 0x0

17. What value will be in rdx after the following operation(s)
Assume the code will assemble and run without error
Note: This question is asking about RDX
mov rax, 0x10
xor rdx, rdx
mov rbx, 0x4
div rbx

A. 0x4
B. 0x2
C. 0x25
D. 0x0

18. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 1010b
mov rbx, 1100b
and rax, rbx

A. 1110
B. 1000
C. 0111
D. 0110

19. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 1010b
mov rbx, 1100b
or rax, rbx

A. 1110
B. 1000
C. 0111
D. 0110

20. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 1010b
mov rbx, 1100b
xor rax, rbx
A. 1110
B. 1000
C. 0111
D. 0110

21. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xAA
shr al, 2

A. AA
B. 2A
C. A8
D. EA
E. 55

22. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xAA
shl al, 2

A. AA
B. 2A
C. A8
D. EA
E. A0

23. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xAA
sar al, 2

A. AA
B. 2A
C. A8
D. EA
E. A0

24. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xAA
rol al, 2

A. AA
B. 2A
C. A8
D. EA
E. A0


25. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xAA
ror al, 1

A. AA
B. 2A
C. A8
D. EA
E. 55

26. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xf
mov rbx, 0xd
cmp rax, rbx
jge greater
mov rax, rbx
greater:

A. 0x10
B. 0xd
C. 0x8
D. 0xf
E. 0xa

27. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0xf
mov rbx, 0xd
cmp rax, rbx
jl less
mov rax, rbx
less:

A. 0x10
B. 0xd
C. 0x8
D. 0xf
E. 0xa

28. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0x0
mov rcx, 0x10
next:
inc rax
loop next

A. 0x10
B. 0xd
C. 0x8
D. 0xf
E. 0xa

29. What value will be in rax after the following operation(s)
Assume the code will assemble and run without error
mov rax, 0x0
mov rcx, 0x10
next:
inc rax
dec rcx
loop next

A. 0x10
B. 0xd
C. 0x8
D. 0xf
E. 0xa

30. True/False the only difference between ja and jg is that ja is used for unsigned values.

31. True/False the only difference between jb and jg is that jb is used for unsigned values.

32. Which of the below operations will place the address of a variable myVar in rax
A. mov quad [myVar], rax
B. mov rax, quad [myVar]
C. mov rax, myVar
D. mov rax, byte myVar
E. mov rax, addr [myVar]


33. Which of the below operations will move the third byte of the byte array myArray into rax, assume the below operation proceeds the call
mov rax, 0x0

A. mov rax, byte[myArray+3]
B. mov al, byte [myArray+2]
C. mov rax, byte[myArray+2]
D. mov al, byte [myArray+2]
E. mov rax, myArray[3]


34. True/False The below operations represent a proper prolog and epilog operation for saving rax, rbx, rcx and rdx and restoring their values
;prolog
pushrax
pushrbx
pushrcx
pushrdx

;epilog
poprax
pporbx
poprcx
poprdx

35. What value will be in rax after the following operation(s)
%macro macro1 2
mov %2, %1
%endmacro

mov rax, 0xf
mov rbx, 0xf0
macro1rbx, rax

A. 0xf
B. 0xff
C. 0x00
D. 0xf0
E. This macro will fail to compile

36. What value will be in rax after the following operation(s)
%macro macro1 2
mov %2, %1
%endmacro

mov rax, 0xf
mov rbx, 0xf0
macro1rbx, rax
macro1rbx, rax

A. 0xf
B. 0xff
C. 0x00
D. 0xf0
E. This macro will fail to compile

37. What value will be in rax after the following operation(s)
%macromacro2 2
push rcx
mov rcx, %2
%%nextIter:
add %1, %1
loop %%nextIter
%endmacro

mov rax, 0x1
mov rbx, 0x4
macro2rax, rbx

A. 0x10
B. 0x01
C. 0x100
D. 0x4
E. This macro will fail to compile

38. What value will be in rax after the following operation(s)
%macro macro2 2
push rcx
mov rcx, %2
%%nextIter:
add %1, %1
loop %%nextIter
%endmacro

mov rax, 0x1
mov rbx, 0x4
macro2rax, rbx
macro2rax, rbx

A. 0x10
B. 0x01
C. 0x100
D. 0x4
E. This macro will fail to compile

39. True/False The execution of a macro differs from that of a function in that the function is copied and pasted by the assembler, but the macro is placed only once in the code no matter how many times it is used.

40. What is added to the beginning of a label in a macro to allow it to be unique for each instance of that macro in a program?
A. @
B. @@
C. %
D. %%

41. True/False Functions and Proceedures help break up a program into smaller parts, making it easier to code, debug and maintain.

42. Which of these are the main actions of a function call?
A. Invocation and Linkage
B. Linkage and Argument Transmission
C. Argument Transmission and Invocation
D. None of the above

43. Which registers are used for Floating point numbers when being passed to/from functions?
A. General Purpose Registers
B. rdx:rax
C. xmm0-xmm7
D. xmm0-xmm15

44. With reference to the cdecl calling convention taught in this course.
How are the first 6 parameters passed.
A. Using 6 registers
B. Using the stack
C. Using 4 registers and the stack
D. using the heap

45. With reference to the cdecl calling convention taught in this course.
When passing more than 6 non Floating point values.
The Caller function must do all of the below operations, except?
A. Move the first 6 values into the defined registers
B. Push the remaining values in reverse order on the stack
C. Preserve the rsp pointer
D. Call the function
E. Change the stack pointer by adding 8*(number of stack parameters)

46. With reference to the cdecl calling convention taught in this course.
When passing more than 6 non Floating point values.
The Callee function must do all of the below operations, except?
A. Move the rsp pointer into rbp
B. Push ancallee saved registers to the stack
C. Preserve the rbp pointer
D. Pop all callee saved registers from the stack
E. Change the stack pointer by adding 8*(number of stack parameters)

47. The following Code is invoked

STDIN             equ      0
SYS_read        equ      0

inChars           db        "Chars"

msgLen           dq        11


mov                             rax,      SYS_read

mov                             rdi,      STDIN

mov                             rsi,       inChar

mov                             rdx,     2

syscall

Reg SYS_read
rax SYS-read (0)
rdi Input location, STDIN (0)
rsi Address to Store Chars
rdx Number of Chars to read

The user types in ‘Testing', and then presses enter
What is the result of the input data

A. The inChars value is filled with ‘Testi',msgLen is overwriten with ‘ng'
B. A segmentation fault occurs
C. The inChars value is ‘Tears' and nothing else is overwritten
D. The inChars value is ‘Testi' and nothing else is overwritten

48. To export a function in Intel Assembly for x86_64 in Linux (as we have learned in class) you need to use the following syntax
A. externmyFunction
B. globalmyFunction
C. functionmyFunction
D. myFunction:

49. To access an exported function from another object file use this syntax to link the function.
A. externmyFunction
B. globalmyFunction
C. functionmyFunction
D. callmyFunction

50. The execution of an Interupt Vector follows which order of the steps listed below? (for instance if they run in the reverse of the order below it would be 5 4 3 2 1)

1. Jump to the Interrupt Service Routine
2. Resume the program
3. Suspend the running program
4. Look up the ISR in the Vector Table
5. Execute the Service Routine

A. 1 2 3 4 5
B. 5 4 3 2 1
C. 3 4 1 5 2
D. 3 1 4 5 2

51. Bonus Question
Complete the following sentence.
(There is no wrong answer, except if its blank)
Assembly language will never die:
A. But I will never use it again!
B. Because it is the best language ever!
C. Not!
D. movrax, 0xff
E. None of the above

Notes:

• When writing a binary value greater than 0xff I will put a space between each nibble like this, 1010 0011 this is to make it easier to read, and should not be considered an actual space. 10100011 is the same as 1010 0011 for this exam
• The code questions and examples are written in Intel style for x86_64 running on Linux, just as we have studied and the labs have been written in.

Attachment:- interrupt lab.zip

Reference no: EM132304522

Questions Cloud

State-of-the art developments in automatic deception : Computer and information security Write an essay on state-of-the art developments in automatic Deception - Your assignment should be maximum 1500 words
How leaders should handle a situation where an employee : Propose a brief set of coaching points for how leaders should handle a situation where an employee or a customer is extremely emotional.
Describe specific strategies used by public health programs : Describe specific strategies used by public health programs for preventing and controlling the specific pathogen in local and global settings.
What are your beliefs about people in organizations : What are your beliefs about people in organizations, people outside organizations, power, processes/policies, and profit?
Examine the execution of a program : What is the proper order of operation for these operations, performed by the Loader, Linker and Assembler - Examine the execution of a program
Compare the mitigation strategies for the different pathogen : Choose an example pathogen that can be transmitted by more than one source (waterborne, foodborne, vector-borne, airborne).
What specific characteristics exist for the different agents : Differentiate between how biological, chemical, and physical agents affect human health. What specific characteristics exist for the different agents?
Analyze the relationship between servant leadership : Analyze the relationship between servant leadership and ethical leadership, including moral intelligence.
Describe the recent outbreaks of contaminated food : What was the source of contamination, and what were the resulting symptoms that the victims suffered? How can we ensure food safety in our own lives?

Reviews

Write a Review

Assembly Language Questions & Answers

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd