Information Technology Reference
In-Depth Information
EXERCISES
1. What is the difference between each of the following pairs?
. Compilers and assemblers
. Source code and target code
. Mnemonics and hexadecimal representation
. Pseudo instructions and instructions
. Labels and addresses
. Symbol table and opcode table
. Program counter (PC) and instruction location counter (ILC)
2. Using the assembly language of the simple processor in Section 3.1, write
assembly code segments to do the following operation:
. Swap two numbers
. Logical OR
. Negation
3. Add input / output instructions to the instruction set of the simple processor in
Section 3.1 and write an assembly program to find the Fibonacci sequence.
4. Obtain the machine language code of the multiplication assembly program
given in Section 3.2.
5. With the great advances in high-level languages and compilers, some people
argue that assembly language is not important anymore. Give some argu-
ments for and against this view.
6. Write a program segment using the instruction of the X86 family to compute
P 200
i ΒΌ 1 X i Y i , where X i and Y i are signed 8-bit numbers. Assume that no over-
flow will occur.
7. Write a subroutine using the X86 instructions that can be called by a main
program in a different code segment. The subroutine will multiply a signed
16-bit number in CX by a signed 8-bit number in AL. The main program
will call this subroutine, store the result in two consecutive memory words,
and stop. Assume that SI and DI contain the signed 8-bit and 16-bit numbers,
respectively.
8. Write a program using the X86 instructions to compare a source string of 100
words pointed to by an offset of 2000H in DS with a destination string
pointed to by an offset 4000H in DS.
9. Write a program using the X86 instructions to generate the first 10 numbers
of the Fibonacci series, that is, to generate the series 1, 1, 2, 3, 5, 8, 13, 21, 34.
10. Write a program using the X86 instructions to convert a word of text from
upper case to lower case. Assume that the word consists of ASCII characters
stored in successive memory locations starting at location START and ending
at location FINISH.
Search WWH ::




Custom Search