Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

Assembly Language Midterm Review Guide with complete solution

Beoordeling
-
Verkocht
-
Pagina's
17
Cijfer
A+
Geüpload op
12-03-2023
Geschreven 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.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

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

Geschreven voor

Vak

Documentinformatie

Geüpload op
12 maart 2023
Aantal pagina's
17
Geschreven in
2022/2023
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$11.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
LECTMAGGY Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
146
Lid sinds
3 jaar
Aantal volgers
121
Documenten
6311
Laatst verkocht
1 week geleden
LECTMAGGY

Here, you will find everything you need in NURSING EXAMS AND TESTBANKS.Contact us, to fetch it for you in minutes if we do not have it in this shop.BUY WITHOUT DOUBT!!!!Always leave a review after purchasing any document so as to make sure our customers are 100% satisfied.

3.3

28 beoordelingen

5
8
4
3
3
11
2
0
1
6

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen