SYST 26671: On the 8086 Processor Suppose Register CS Contains 7C09h and IP Contains 0202h: Computer Architecture Assignment, SC, Canada
|University||Sheridan College (SC) Canada|
|Subject||SYST 26671: Computer Architecture|
1. On the 8086 processor suppose register CS contains 7C09h and IP contains 0202h. Give the 20-bit effective address of the instruction to be fetched. Show your work and final answer below.
2. In your own words, explain the difference between a half-adder and a full 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.
a) 9 – (4 + 33) * 15
b) -1089 * ( 10404 / 89)
Place the answer in the AX register.
Place the answer in the DX and AX registers.
Remember: Use IMUL/IDIV for neg. numbers.
The correct answer in raw hex is FFFE128C.
7. Below is the logic circuit of the simple ALU we saw in class. Answer the questions on the next page related to this circuit.
a) How many input bits are there in total?
b) Output bits?
c) Assume A = 1, B = 0, F0 = 1, F1 = 1.
What is the logic state of the signal marked ‘*’? Enter 0 or 1
d) The circuit shown above is a 1-bit 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 connected to ___
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 the 8086 assembly language, how many bits are in the result of a word multiply? Why? (explain)
10. In box (a) below write an 8086 program that sets the data segment register to 200h, then writes the decimal value 555 to memory at offset 20h (effective address 02020h). 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 (20h). 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.)
mov bx, 5
mov ax, bx
sub bx, 1
add ax, bx
cmp bx, 0
- 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.
|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|
- How many times does the JNE instruction gets executed? Enter value
13. Using the emulator write an 8086 assembly program that displays your name on the screen (including first and last name). 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 space below.