100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Assembly Language Midterm Review Guide with complete solution $11.49   Add to cart

Exam (elaborations)

Assembly Language Midterm Review Guide with complete solution

 4 views  0 purchase
  • Course
  • Institution

Assembly Language Midterm Review Guide with complete solution 1. How do assemblers and linkers work together? An assembler converts source-code programs from assembly language into machine language. A linker combines individual files created by an assembler into a single executable program. 3....

[Show more]

Preview 3 out of 17  pages

  • March 12, 2023
  • 17
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
Assembly Language Midterm Review Guide with complete
solution
1. How do assemblers and linkers work together?
An assembler converts source-code programs from assembly language into machine
language. A linker combines individual files created by an assembler into a single
executable program.
3. What is meant by a one-to-many relationship when comparing a high-level language
to machine language?
In a one-to-many relationship, a single statement expands into multiple assembly
language or machine instructions.
4. Explain the concept of portability as it applies to programming languages.
A language whose source programs can be compiled and run on a wide variety of com-
puter systems is said to be portable.
5. Is the assembly language for x86 processors the same as those for computer
systems such as the Vax or Motorola 68x00?
No. Each assembly language is based on either a processor family or a specific
computer.
6. Give an example of an embedded systems application.
Some examples of embedded systems applications are automobile fuel and ignition
sys- tems, air-conditioning control systems, security systems, flight control systems,
hand-held computers, modems, printers, and other intelligent computer peripherals.
7. What is a device driver?
Device drivers are programs that translate general operating system commands into
specific references to hardware details that only the manufacturer knows.
8. Do you suppose type checking on pointer variables is stronger (stricter) in assembly
language, or in C and C++?
No, C++ does not allow a pointer of one type to be assigned to a pointer of another
type. Assembly language has no such restriction regarding pointers.
9. Name two types of applications that would be better suited to assembly language
than a high-level language.
Applications suited to assembly language: hardware device driver and embedded
systems and computer games requiring direct hardware access.
10. Why would a high-level language not be an ideal tool for writing a program that
directly accesses a printer port?
A high-level language may not provide for direct hardware access. Even if it does, awk-
ward coding techniques must often be used, resulting in possible maintenance
problems.
11. Why is assembly language not usually used when writing large application
programs?
Assembly language has minimal formal structure, so structure must be imposed by
programmers who have varying levels of experience. This leads to difficulties
maintaining existing code.
12. Challenge: Translate the following C++ expression to assembly language, using the
example presented earlier in this chapter as a guide: X = (Y * 4) + 3.

,mov eax,Y ; move Y to EAX
mov ebx,4 ; move 4 to EBX
imul ebx ; EAX = EAX * EBX
add eax,3 ; add 3 to EAX
mov X,eax ; move EAX to X
1.2.1
-----

1. In your own words, describe the virtual machine concept.
Virtual machine concept: Computers are constructed in layers, so that each layer repre-
sents a translation layer from a higher-level instruction set to a lower-level instruction
set.
2. Why do you suppose translated programs often execute more quickly than
interpreted ones?
2. A translated program is often faster because it is coded in a language that can be
directly executed on the target machine. This is not the case with interpreted programs,
since they must be translated while they are running.
3. (True/False): When an interpreted program written in language L1 runs, each of its
instructions is decoded and executed by a program written in language L0.
3. True.
4. Explain the importance of translation when dealing with languages at different virtual
machine levels.
4. An entire L1 program is converted into an L0 program by an L0 program specifically
designed for this purpose. Then the resulting L0 program is executed directly on the
com- puter hardware.
5. At which level does assembly language appear in the virtual machine example shown
in this section?
5. Assembly language appears at Level 3.
6. What software utility permits compiled Java programs to run on almost any
computer?
6. The Java virtual machine (JVM) allows compiled Java programs to run on almost any
computer.
7. Name the four virtual machine levels named in this section, from lowest to highest.
7. Digital logic, instruction set architecture, assembly language, high-level language.
8. Why don't programmers write applications in machine language?
8. Machine language is difficult for humans to understand, since it provides no visual
clues relating to the instruction syntax.
9. Machine language is used at which level of the virtual machine shown in Figure 1-1?
9. Instruction set architecture.
10. Statements at the assembly language level of a virtual machine are translated into
statements at which other level?
10. Level 2 (Instruction Set Architecture).
1.3
----

1. Explain the term least significant bit (LSB).

, 1. The Least Significant Bit is position 0, having the value of 2 to the zero power.
2. What is the decimal representation of each of the following unsigned binary integers?
a. 11111000 b. 11001010 c. 11110000
2. (a) 248 (b) 202 (c) 240
3. What is the sum of each pair of binary integers?
a. 00001111 00000010 b. 11010101 01101011 c. 00001111 00001111
3. (a) 00010001 (b) 101000000 (c) 00011110
4. How many bytes are contained in each of the following data types?
a. word
b. doubleword
c. quadword
d. double quadword
4.(a)2 (b)4 (c)8 (d)16
5. What is the minimum number of binary bits needed to represent each of the following
unsigned decimal integers?
a. 65
b. 409
c. 16385
5. (a) decimal 65 requires 7 bits (b) decimal 409 requires 9 bits (c) decimal 16,385
requires 15 bits
6. What is the hexadecimal representation of each of the following binary numbers?
a. 0011 0101 1101 1010 b. 1100 1110 1010 0011 c. 1111 1110 1101 1011
6. (a) 35DA (b) CEA3 (c) FEDB
7. What is the binary representation of the following hexadecimal numbers?
a. A4693FBC b. B697C7A1 c. 2B3D9461
7. (a) A4693FBC = 1010 0100 0110 1001 0011 1111 1011 1100 (b) B697C7A1 = 1011
0110 1001 0111 1100 0111 1010 0001 (c) 2B3D9461 = 0010 1011 0011 1101 1001
0100 0110 0001
1.4
---

1. Describe the following boolean expression: ¬X ∨ Y.
1. (NOT X) OR Y
2. Describe the following boolean expression: (X ∧ Y).
2. X AND Y
3. What is the value of the boolean expression (T ∧ F) ∨ T ?
3. T
4. What is the value of the boolean expression ¬(F ∨ T) ?
4. F
5. What is the value of the boolean expression ¬F ∨ ¬T ?
5. T
1.7 No (Ans)
---

1. In an 8-bit binary number, which is the most significant bit (MSB)?

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller LECTMAGGY. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $11.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76669 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$11.49
  • (0)
  Add to cart