Question
1. On the 8086 processor suppose register CS contains 6D08h and IP contains 0116h. Give the 20-bit effective address of the instruction to be fetched.
1. On the 8086 processor suppose register CS contains 6D08h and IP contains 0116h. Give the 20-bit effective address of the instruction to be fetched.
2. In your own words, explain the difference between a full adder and a half adder. In your description include the number of input bits and output bits for each circuit.
3. Choose two flags (bits) from the 8086 status register, also known as flags register. In your own words briefly describe the purpose of each flag and how it works.
4. The Internet Protocol IP and related higher-level protocols e.g. TCP are used for communication over the Internet. These protocols define the network byte order to be big-endian. This means numeric values are transmitted using big-endian byte order. Describe what must be done when software running on a little-endian CPU e.g. your laptop sends a 32-bit integer over the internet as part of the Internet Protocol.
5. An assembler translates assembly language to machine language instructions. A disassembler can be used to translate the other way, from machine language to assembly language. For example, our 8086 emulator shows both the machine language bytes and the disassembler output while running a program (it also shows the original assembly source code, current line highlighted in yellow). The disassembled code is usually harder to read than the original assembly language program because some things may be missing, changed, or incorrect. Write down two of the things that may be missing, changed or incorrect.
6. Write 8086 assembler programs (using the emulator) that will perform the following calculations. All numbers are shown here in decimal. Paste each program in the space on the next page. Note: You can use decimal values in assembly language programs without converting to hex, if desired. For division do integer division and ignore the remainder, i.e. use the quotient only. 605 - (4 + 33) * 15 b) -1089 * ( 10404 / 89) Remember: Use IMUL/IDIV for neg. numbers. FFFE128C. (a) (b)
7. Below is the logic circuit of the simple ALU we saw in class. Answer the questions below and on the next page related to this circuit.
a) How many input bits are there in total? Enter number b) Output bits?
c) Assume A = 1, B = 0, F0 = 1, F1 = 1. Enter 0 or 1 What is the logic state of the signal marked '*'?
d) The circuit shown above is a 1-bit ALU. A 64-bit processor like the Intel processor in your laptop would use 64 copies of this circuit connected together to form a 64-bit ALU which can perform arithmetic and logic operations on 64-bit values. In such a circuit the Carry Out from bit 0 is
8. Consider the following circuit diagram. In your own words describe one possible limitation of this circuit if it was used in a real CPU design. Also describe in general terms what should be done to fix the limitation.
9. In 8086 assembly language, how many bits are in the result of a word multiply? Why? (explain why this many bits are needed)
10. In box (a) below write an 8086 program that sets the data segment register to 800h, then writes the decimal value 555 to memory at offset 40h (effective address 08040h). Do not use the BX register to access memory. Hint: You can write data to a specific memory offset using MOV [offset], reg In this case the square brackets can also be omitted, e.g. MOV offset, reg In box (b) rewrite the program from (a) so it uses the BX register to provide the memory offset. Hint: In this case square brackets will be required.
11. a) How many 8086 software interrupts are possible? (including sub-functions)
b) How many are currently supported by the emulator? (for part b use your emulator documentation)
12. Consider the following program. (Note that assembly language is generally case-insensitive so you can write instruction words and register names in upper or lower case.) a) Single-step through the program and complete the following table. Here "# of bytes" refers to the length of each instruction in bytes, and "hex value" is the machine language equivalent of each assembly instruction. Lines like "ORG 100h" and labels are omitted because these are assembler directives that don't generate any machine code. The first row has been filled in as an example. [2 marks] Instruction Hex Value # of Bytes mov bx, 5 BB 05 00 3 mov ax, bx Value Value sub bx, 1 Value Value add ax, bx Value Value cmp bx, 0 Value Value jne back Value Value ret Value Value Enter value b) How many times does the JNE instruction get executed?
13. Using the emulator write an 8086 assembly program that displays your name on the screen (including first and last name, with a space between them). Do NOT use any programming techniques that have not yet been taught in class as of the assignment due date. Paste the program in the box below.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started