Beruflich Dokumente
Kultur Dokumente
http://ganeshniyer.com/
EE2007
Microprocessor systems
Tutorial 1 Semester 1 AY 2010-11
Ganesh Iyer
ganesh.vigneswara@gmail.com (facebook, gtalk)
http://ganeshniyer.com
Ganesh Iyer
http://ganeshniyer.com/
About Me
I have 3 years of Industry work experience in Bangalore, India.
I have finished my masters from NUS in 2008.
Currently doing PhD under the guidance of Assoc/Prof. Bharadwaj Veeravalli.
Research interests: Cloud computing, Game theory, Wireless Networks
Office: Computer Networks and Distributed Systems Lab, E4, Level 6, Room 12
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
Introduction
Bus
Ganesh Iyer
http://ganeshniyer.com/
Introduction
Register
Ganesh Iyer
http://ganeshniyer.com/
Introduction
void main()
{
int a=10,b=20;
--}
Object code
Assembly code
(e.g. 8086, pentium)
Executable Binary
(0s and 1s)
MOV AX, 10
MOV BX,20
----01010100011
10011101010
----
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
Vendors Firmware
ROM-BIOS
64+ kbytes
No installed memory
Video-ROM
0x00007E00
0x00007C00
0x00000500
0x00000400
0x00000000
VRAM
128 kbytes
RAM
Different
Segments
(CS,DS,ES,
SS) are
created
here
256 bytes
1024 bytes
1-MB
Ganesh Iyer
http://ganeshniyer.com/
(5,12,13) Registers
General Purpose Data Registers:
AX
BX
CX
DX
Segment Registers:
CS Code segment : Program Instructions
AX 16 bit
AH 8 bits MSB
AL 8 bits LSB
Ganesh Iyer
http://ganeshniyer.com/
(4) Segments
Ganesh Iyer
http://ganeshniyer.com/
4 x 64K
4 segments = CS, DS, SS, and ES each of size 64K
Ganesh Iyer
http://ganeshniyer.com/
A000h
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
CS*10h+IP
= 0200h*10h+01ACh
= 02000+01AC = 021ACh
Ganesh Iyer
http://ganeshniyer.com/
A004
12
A003
34
A002
56
A001
78
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
Jump Carry
jump if CF = 1
Jump No Zero
jump if ZF = 0
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
Ganesh Iyer
http://ganeshniyer.com/
Reset Address
Ganesh Iyer
http://ganeshniyer.com/
DUP operator
If you need to declare a large array you can use DUP operator. The syntax for DUP:
Ganesh Iyer
http://ganeshniyer.com/
BONUS!!!!
If the current values in CS and IP are 0200h and
01AEh respectively, what is the address of the
next instruction?
Ganesh Iyer
http://ganeshniyer.com/
BONUS!!!
The last stored items in the stack are the
following hexadecimal values: 08, FA, 14, 92, 5E,
38 (very last), etc. Assume SS=00E0h and
SP=01CBh. What is the physical address of the
location containing 38?
Item 38 is at the top of the stack since it is stored very last. The
physical address of top of the stack = SS: SP or 10h*SS + SP =
00E00 + 01CB = 00FCBh.
Ganesh Iyer
http://ganeshniyer.com/
BONUS!!!
The size of your memo.txt file on your 8088based PC is 365 bytes. Suppose this file is placed
at the memory address DS:SI = 1200:25FF, what
should be the address of last byte of this file?
The starting address of the file is 12000+25FF = 145FFh.
365 bytes in Hex is 16D bytes.
The last byte of this file should locate at
145FF + 16D 1 = 1476Bh.
Ganesh Iyer
http://ganeshniyer.com/
BONUS!!!
Which flag determines whether the address for a
string operation is incremented or decremented?
And which flag determines if interrupt to the
micro-processor is enabled?
Ganesh Iyer
http://ganeshniyer.com/
BONUS!!!
What are the word sizes of the 8086/8088 and
the 80386?
16-bit and 32-bit, respectively.
Thank you!
http://ganeshniyer.com