• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 17 páginas
Examen

Assembly Language Midterm Review Guide with complete solution

Document preview thumbnail
Vista previa 3 fuera de 17 páginas

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.

Vista previa del contenido

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

Información del documento

Subido en
13 de marzo de 2023
Número de páginas
17
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas
$11.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
magdamwikash23
3.9
(14)
Vendido
116
Seguidores
94
Artículos
5324
Última venta
2 semanas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes