Vous êtes sur la page 1sur 13

Assembly

Sheet .1

formatted by: Samuel Makarem

1-How do assemblers and linkers work together?


An assembler converts source-code programs from assembly language
into machine lan- guage. A linker combines individual files created by
an assembler into a single executable program.

2-How will studying assembly language enhance your
understanding of operating systems?
Assembly language is a good tool for learning how application programs
communicate with the computer's operating system via interrupt
handlers, system calls, and common memory areas. Assembly language
programming also helps when learning how the operat- ing system
loads and executes application programs.

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 systems, 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.


2
8-Do you suppose type checking on pointer
variables is stronger (stricter) in assembly
language, or in C and C++?
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, awkward 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.

Assembly Sheet.2

1-In your own words, describe the virtual machine


concept.
Virtual machine concept: Computers are constructed in layers, so that
each layer represents a translation layer from a higher-level instruction
set to a lower-level instruction set.

2-Why don't programmers write application


programs in machine language?
Machine language: It is enormously detailed and consists purely of
numbers. Hard for humans to understand.

3-Why don't programmers write applications in


machine language?
Machine language is difficult for humans to understand, since it
provides no visual clues relating to the instruction syntax.

4-When an interpreted program written in


language L1 runs, each of its instructions is
decoded and executed by a program written in
language L0.
True



5-Explain the technique of translation when
dealing with languages at different virtual machine
levels.
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 computer hardware.

6-At which level does assembly language appear in


the virtual machine example shown in this
section?
Assembly language appears at Level 3.

7-What software permits compiled Java programs


to run on almost any computer?
The Java virtual machine (JVM) allows compiled Java programs to run
on almost any computer.

5
8-Name the four virtual machine levels named in
this section, from lowest to highest.
Digital logic, instruction set architecture, assembly language, high-level
language.

9-Machine language is used at which level of the


virtual machine shown in Figure 1-1?
Instruction set architecture.

10-Statements at the assembly language level of a


virtual machine are translated into statements
at which other level?
Level 2 (instruction set architecture)

6
Assembly Sheet.3

1-Explain the term Least Significant Bit (LSB).


Least significant bit (bit 0). Bit to the far right.

2-Explain the term Most Significant Bit (MSB).


Most significant bit (the highest numbered bit). Bit to the far
left.

3-What is the decimal representation of each of the


following unsigned binary integers?
a. 11111000
b. 11001010
c. 11110000

(a) 248 (b) 202 (c) 240


4-What is the decimal representation of each of the


following unsigned binary integers?
a. 00110101
b. 10010110
c. 11001100

(a) 53 (b) 150 (c) 204


5-What is the sum of each pair of binary integers?


a. 00001111 " 00000010
b. 11010101 " 01101011
c. 00001111 " 00001111
(a) 00010001 (b) 101000000 (c) 00011110

7
What is the sum of each pair of binary integers?
a. 10101111 " 11011011
b. 10010111 " 11111111
c. 01110101 " 10101100
(a) 110001010 (b) 110010110 (c) 100100001

6-How many bytes are contained in each of the


following data types?
a. word
b. doubleword
c. quadword
(a) 2 (b) 4 (c) 8

7-How many bits are contained in each of the following


data types?
a. word
b. doubleword
c. quadword
(a) 16 (b) 32 (c) 64

8-What is the minimum number of binary bits needed


to represent each of the following
unsigned decimal integers?
a. 65
b. 256
c. 32768
(a) 7 (b) 9 (c) 16

8
9-What is the minimum number of binary bits needed
to represent each of the following
unsigned decimal integers?
a. 4095
b. 65534
c. 2134657
(a) 12 (b) 16 (c) 22

10-What is the hexadecimal representation of each of


the following binary numbers?
a. 1100 1111 0101 0111
b. 0101 1100 1010 1101
c. 1001 0011 1110 1011
(a) CF57 (b) 5CAD (c) 93EB

11-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
(a) 35DA (b) CEA3 (c) FEDB

12-What is the binary representation of the following


hexadecimal numbers?
a. E5B6AED7
b. B697C7A1
c. 234B6D92
(a) 1110 0101 1011 0110 1010 1110 1101 0111
(b) 1011 0110 1001 0111 1100 0111 1010 0001
(c) 0010 0011 0100 1011 0110 1101 1001 0010

9
13-What is the binary representation of the following
hexadecimal numbers?
a. 0126F9D4
b. 6ACDFA95
c. F69BDC2A
(a) 0000 0001 0010 0110 1111 1001 1101 0100
(b) 0110 1010 1100 1101 1111 1010 1001 0101
(c) 1111 0110 1001 1011 1101 1100 0010 1010

14-What is the unsigned decimal representation of each


hexadecimal integer?
a. 3A
b. 1BF
c. 4096
(a) 58 (b) 447 (c) 16534

15-What is the unsigned decimal representation of each


hexadecimal integer?
a. 62
b. 1C9
c. 6A5B
(a) 98 (b) 457 (c) 27227

16-What is the 16-bit hexadecimal representation of


each signed decimal integer?
a. !26
b. !452
(a) FFE6 (b) FE3C

10
17-What is the 16-bit hexadecimal representation of
each signed decimal integer?
a. !32
b. !62
(a) FFE0 (b) FFC2

18-The following 16-bit hexadecimal numbers represent


signed integers. Convert to decimal.
a. 7CAB
b. C123
(a) +31915
(b) -16093

19-The following 16-bit hexadecimal numbers represent


signed integers. Convert to decimal.
a. 7F9B
b. 8230
(a) +32667
(b)32208

20-What is the decimal representation of the following


signed binary numbers?
a. 10110101
b. 00101010
c. 11110000
(a) 75
(b) +42
(c) 16


11
21-What is the decimal representation of the following
signed binary numbers?
a. 10000000
b. 11001100
c. 10110111
a) -128
b) -52
c) -73

22-What is the 8-bit binary (two's-complement)


representation of each of the following signed
decimal integers?
a. -5
b. -36
c. -16
(a) 11111011 (b) 11011100 (c) 11110000

23-What is the 8-bit binary (two's-complement)


representation of each of the following signed
decimal integers?
a. -72
b. -98
c. -26
(a) 10111000 (b) 10011110 (c) 11100110

24-What are the hexadecimal and decimal


representations of the ASCII character capital X?
58h and 88d.

25-What are the hexadecimal and decimal


representations of the ASCII character capital M?
4Dh and 77d.

12
26-Why was Unicode invented?
To handle international character sets that require more than
256 codes.

27-What is the largest value you can represent using a


256-bit unsigned integer?
2^256 -1

28-What is the largest positive value you can represent


using a 256-bit signed integer?
+2^255 -1






references:
sheet1 :
https://quizlet.com/106504270/chapter-1-basic-concepts-flash-cards/

sheet2,3:
https://quizlet.com/28518304/assembly-chpt-1-flash-cards/


Best wishes
Samuel Makarem

13

Vous aimerez peut-être aussi