Computer Architecture Fall 2015
Assignment Two
Name: _____RAMANDEEP KAUR
Student ID:
991387388_________________________________
Due Dates:
Saturday October 17, before midnight
Instructions: This assignment is to be completed individually (This means by
yourself).
Please submit one (1) single document in Microsoft Word or
PDF format. Incorporating screen shots into the single document.
Please crop your screen shots to show only the relevant
information. Multiple files will not be accepted.
(1 mark) Give the three classifications of the 8086 registers.
(1 mark) Give the names of the segment registers.
(1 mark) Which two registers combine to give the Effective Address of an
instruction that is stored in memory?
(1 mark) Give the effective address if the segment register is AA30 and the offset
register is 0032.
(1 mark) The status register is a 16-bit register. How many bits (in total) are
actually used (within the status register)?
(2 marks) The 32-bit value 0x3311C5B9 is stored starting at memory location
1000. Each memory cell can hold 8 bits.
Address
10000
10001
10002
10003
10001
10002
10003
contents
Little Endian
Address
contents
10000
Big Endian
(6 marks) Write an 8086 assembler program (using the emulator) that will
perform the following calculations. All values below are decimals, but you can
leave your answers in hex. You must attach
Screenshot of emu8086 showing the different register values at the end
of the execution
A copy of your code (screenshot is OK)
Your program must store the answer in the AX register.
(6 +3) * (50 - 30).
5 - (7 + 18) + (3 -6)
(c) 20 - (5 7 * 6)
(3 marks) Consider the following program:
Single step through the program.
What does 0x in front of a value mean?
How many times did the instruction sub bx,0x01 get executed?
What value was BX when the program finally halted?
ANSWERS:
1. Three classifications of the 8086 registers are:
a) General Purpose Registers
b) Segment Registers
c) Special Purpose Registers
2. Names of Segment Registers are:
a) Code Segment (CS)
b) Data Segment (DS)
c) Extra Segment (ES)
d) Stack Segment (SS)
3. Offset and segment registers combined together to give
Effective address of an instruction that is stored in its
memory.
4. Segment Register = AA30
Offset Register = 0032
To find Effective Address:
Step 1: Multiply segment register by 10h
AA30 * 10h = 0AA300h
Step 2: Then add this resultant value into offset register
0AA30 + 0032 = 0AA332
So the Effective Address is 0AA332
5. All bits are used within status register.
Little Endian
Address
contents
10000
B9
Big Endian
Address
contents
10000
34
10001
C5
10001
11
10002
11
10002
C5
10003
33
10003
B9
6.
a)
b)
7.
a) "0x" infront of the valye means it the hexadecimal value.
b) "sub bx,0x01" instruction will be 4 times executed.
c) when the program finally halted the value of BX is
000A.