Académique Documents
Professionnel Documents
Culture Documents
Sheet .1
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
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.
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.
6
Assembly Sheet.3
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
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
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
10
17-What is the 16-bit hexadecimal representation of
each signed decimal integer?
a. !32
b. !62
(a) FFE0 (b) FFC2
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
12
26-Why was Unicode invented?
To handle international character sets that require more than
256 codes.
13