Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 28 pages
Exam (elaborations)

CSCI3130 FINAL EXAM QUESTIONS AND ANSWERS 100% SOLVED

Document preview thumbnail
Preview 3 out of 28 pages

CSCI3130 FINAL EXAM QUESTIONS AND ANSWERS 100% SOLVED ...

Content preview

CSCI3130 FINAL EXAM QUESTIONS AND ANSWERS
100% SOLVED


Why do you need to make register rax 0 before calling C inbuilt function: printf? - ANSWER
printf uses a variable number of arguments and rax specifies how many SSE registers (for
floating-points) are used for the arguments. In our case we don't use any.




Major difference between high-level language vs low-level languages? - ANSWER High level

languages have a high level of abstraction from the hardware.




Explain the term abstraction in regards to programming languages? - ANSWER Making a
sandwich

-- High level of abstraction: push a button to make a sandwich. No need to know any details
of how to make sandwich

-- Low level of abstraction: need to know how to place the components of the sandwich,
where should the bread go, where should the cheese go and so on.

-- No level of abstraction can be should be able to make bread, cheese and other

components.




What are the advantages of learning assembly language? - ANSWER • Some architectures
don't have C compilers...

-- Instead, they have embedded systems and/or micro-controllers

• Writing compilers

,• Real speedups

• Develop a better understanding of how the processor/compiler/language functions




How many general-purpose registers are there in x86_64 processor? - ANSWER 16




Why do you need to make register rdx 0 before division? - ANSWER Any non- zero number
will make the dividend {rdx,rax} a very large number.




What happens to rdx and rax after the mul instruction? - ANSWER -Leftmost 64 bits of the
result are stored in rdx

-Rightmost 64 bits of the results are stored in rax




How do we recognize comments in assembly code? - ANSWER Semicolon (;)




What does "global" assembler directive do? - ANSWER Allows assembly functions and labels
to be accessible to code in other object files (.o)




System calls are performed using which instruction? - ANSWER syscall




What instruction is used to call assembly functions, as well as external (C, C++, Fortran)
functions? - ANSWER call

, Distinguish between section .text and section .data. - ANSWER Executable assembly
instructions are typically placed in the .text section and static data/variable declarations are
placed in the .data section




Syscall argument order: - ANSWER rdi, rsi, rdx, r10, r8, r9




Function argument order: - ANSWER rdi, rsi, rdx, rcx, r8, r9




Distinguish between db, dw, dd, and dq. - ANSWER •db = 1 byte or 8 bits

•dw = 2 bytes (word) or 16 bits

•dd = 4 bytes (double word) or 32 bit

•dq = 8 bytes (quadword) or 64 bits




f register rsi = 10 and rdx = 16, what would be the value of rax after the following instruction?

lea rax, [rdx+rsi*8] - ANSWER 96




Let's assume the following array "Array" with 16 64-bit integers:

Array: dq 3, 5, 9, 81, 13, 2, 6, 24, 33, 21, 19, 40, 93, 48, 91, 78

Using the array "Array" answer what value is moved to the %rax register based on the

following instructions:




mov rdi, 5

Document information

Uploaded on
October 30, 2025
Number of pages
28
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$22.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Zayla
3.4
(18)
Sold
123
Followers
13
Items
15811
Last sold
1 week ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions