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
Exam (elaborations)

Assembly Language Midterm Review Guide with complete solution

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
13-03-2023
Written in
2022/2023

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.

Show more Read less
Institution
Course

Content preview

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)?

Written for

Course

Document information

Uploaded on
March 13, 2023
Number of pages
17
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$11.99
Get access to the full document:

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

Get to know the seller

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.
magdamwikash23 Western Governers University
Follow You need to be logged in order to follow users or courses
Sold
113
Member since
3 year
Number of followers
94
Documents
5328
Last sold
1 month ago
Magda

NURSING STUDY GUIDES/EXAMS AND NOTES ALL VERIFIED BY EXPERTS All my uploaded documents, exams and essays are verified by relevant experts.I can assure an A or at least 90% if you use any of my documents.

3.9

14 reviews

5
7
4
2
3
2
2
2
1
1

Recently viewed by you

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