You are on page 1of 5

ASSEMBLY LANGUAGE MANUALS 5,6

CHAPTER 5 MANUALLS

1. A link library consists of assembly language source code.

False (it contains object code).

2. What is the name of the 32-bit link library supplied with


this book?

Irvine32.lib.

3. Which library contains functions called from


Irvine32.lib?

Kernel32.lib.

4. What type of file is kernel32.dll?

Kernel32.dll is a dynamic link library that is a fundamental part of the


MS-Windows operating system.

5. Which procedure in the link library generates a


random integer within a selected range?
RandomRange procedure

6. Which procedure in the link library displays "Press [Enter]


to continue. . ." and waits for the user to press the Enter key?

WaitMsg procedure.

7. Write statements that cause a program to pause for 700


milliseconds.

Code example:
mov eax,700
call Delay

8. Which procedure from the link library writes an


unsigned integer to the console window in decimal
format?

WriteDec procedure.

9. Use the PROTO directive to declare a procedure


named MyProc in an external link library.

MyProc PROTO

CHAPTER 6 MANUALLS
1. In the following instruction sequence, show the resulting
value of AL where indicated, in binary: mov al,01101111b
and al,00101101b ; a.
mov al,6Dh
and al,4Ah ; b. mov
al,00001111b or
al,61h ; c.
mov al,94h xor
al,37h ; d.
(a) 00101101
(b) 01001000
(c) 01101111
(d) 10100011

1. In the following instruction sequence, show the


resulting value of AL where indicated, in hexadecimal:
mov al,7Ah
not al ; a. mov
al,3Dh and
al,74h ; b. mov
al,9Bh
or al,35h ; c.
mov al,72h
xor al,0DCh ; d.
(a) 85h
(b) 34h
(c) BFh
(d) AEh
1. In the following instruction sequence, show the values of
the Carry, Zero, and Sign flags where indicated: mov
al,00001111b
test al,00000010b ; a.
mov al,00000110b cmp
al,00000101b ; b. mov
al,00000101b cmp
al,00000111b ; c.
(a) CF=0, ZF=0, SF=0
(b) CF=0, ZF=0, SF=0
(c) CF=1, ZF=0, SF=1

1. Write a single instruction using 16-bit operands that clears


the high 8 bits of AX and does not change the low 8 bits.
ax,00FFh
1. Write a single instruction (other than NOT) that
reverses all the bits in EAX.
xor eax,0FFFFFFFFh
1. Write instructions that set the Zero flag if the 32-bit value
in EAX is even and clear the Zero flag if EAX is odd.
test eax,1 ; (low bit set if eax is odd)
1. Write a single instruction that converts an uppercase
character in AL to lowercase but does not modify AL if it
already contains a lowercase letter.
al,00100000b
1. Write a single instruction that converts an ASCII digit in AL
to its corresponding binary value. If AL already contains a
binary value (00h to 09h), leave it unchanged.
al,00001111b
1. Write instructions that calculate the parity of the 32- bit
memory operand. Hint: Use the formula presented earlier
in this section: B0 XOR B1 XOR B2 XOR B3.
Code example:
.data
memVal DWORD ?
.code
mov al,BYTE PTR memVal xor
al,BYTE PTR memVal+1 xor
al,BYTE PTR memVal+2 xor
al,BYTE PTR memVal+3

You might also like