handout 2 digital system engineering (ee-390) (ref: text book and kfupm online course of ee-390)...
TRANSCRIPT
![Page 1: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/1.jpg)
Handout 2
Digital System Engineering (EE-390)
(Ref: Text book and KFUPM Online course of EE-390)
(Remember to solve all the related examples, exercises problems as given in the Syllabus)
![Page 2: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/2.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0200
0100
XX XX
00000
01200 8C MOV DX, CS
01201 CA
01202 XX Next Instruction
01203
FFFFF
MOV Statement
01 00
0202P.A’s Mem. contents
![Page 3: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/3.jpg)
Addressing Modes
Accumulator
![Page 4: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/4.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
02F0
0120
XX XX
1B D7
00000
014F0 8B MOV AX, BX
014F1 C3
014F2 XX Next Instruction
014F3
FFFFF
A) Register Operand Addressing Mode
1B D7
02F2P.A’s Mem. contents
![Page 5: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/5.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0260
45A2
1B D7
XX XX
00000
45C80 8B MOV DL, BH
45C81 C3
45C82 XX Next Instruction
45C83
FFFFF
1B
0262
A) Register Operand Addressing ModeP.A’s Mem. contents
![Page 6: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/6.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0400
0210
XX XX
00000
02500 B8 MOV AX, 4A1FH
02501 1F
02502 4A
02503 XX Next Instruction
FFFFF
B) Immediate Operand Addressing Mode
4A 1F
0403P.A’s Mem. contents
![Page 7: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/7.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0400
0210
XX XX
00000
02500 B6 MOV DH, 28H
02501 28
02502 XX Next Instruction
FFFFF
28 XX
0402
B) Immediate Operand Addressing ModeP.A’s Mem. contents
![Page 8: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/8.jpg)
Valid and Invalid InstructionsMOV CL, AH VALIDMOV CX, SP VALIDMOV CH, DX INVALIDMOV 15H, AL INVALIDMOV CL, 1234H INVALIDMOV IP, CX INVALIDMOV CS, DS INVALIDMOV CL, 234H INVALID
![Page 9: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/9.jpg)
C) Memory Operand Addressing Mode
a) Register Indirect Addressing
b) Based Addressing
c) Indexed Addressing
d) Based-Indexed Addressing
1) Direct Memory Addressing
2) Indirect Memory Addressing
![Page 10: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/10.jpg)
C) Memory Operand Addressing Mode
PA = Segment Base Address (SBA) : Effective Address (EA) = SBA : EA EA (called Effective or Offset) is EA = Base + Index + Displacement
PA = SBA : Base + Index + Displacement
CSSSDSES
BXBP
SIDI
PA = : + + 8-bit displacement16-bit displacement
![Page 11: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/11.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
6500
XX XX
00000
03210 8B MOV CX, [52F1H]
03211 0E
03212 F1
03213 52
03214 XX Next Instruction
6A2F1 = DS:52F1 3F
6A2F2= DS:52F2 D2
FFFFF
1) Direct Addressing Mode
D2 3F
0012P.A’s
Mem. contents
Cod
e se
gmen
t
data
seg
men
t
![Page 12: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/12.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
6500
XX XX
00000
03210 8A MOV CH, [52F1H]
03211 2E
03212 F1
03213 52
03214 XX Next Instruction
6500 : 52F1 = DS : 52F1 3F
FFFFF
1) Direct Addressing Mode
3F XX
0014P.A’s Mem. contents
![Page 13: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/13.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
6500
52 XX
00000
03210 88 MOV [52F1H], CH
03211 2E
03212 F1
03213 52
03214 XX Next Instruction
6500 : 52F1 = DS : 52F1 XX
FFFFF
1) Direct Addressing Mode
52
0014P.A’s Mem. contents
![Page 14: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/14.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
6500
XX XX
0528
00000
03210 8B MOV CX, [SI]
03211 1C
03212 XX Next Instruction
03213
03214
6500 : 0528 = DS : SI 5D
6500 : 0529 = DS : SI + 1 CA
FFFFF
2) Register Indirect Addressing Mode
CA 5D
0012P.A’s Mem. contents
![Page 15: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/15.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
6500
XX XX
0528
00000
03210 8A MOV CL, [SI]
03211 0C
03212 XX Next Instruction
03213
03214
6500 : 0528 = DS : SI 5D
FFFFF
2) Register Indirect Addressing Mode
XX 5D
0012P.A’s Mem. contents
![Page 16: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/16.jpg)
NOTEBy default, using a direct address as [1FA4H], or a register indirect address as [SI] or [DI] assumes you are accessing the DATA SEGMENT.
MOV AX, [1FA4H] MOV AX, DS:[1FA4H]
To access any other segment, use the “SEGMENT OVERIDE PREFIX” as
MOV AX, CS:[1FA4H]MOV SS:[DI] , AX
![Page 17: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/17.jpg)
3) Based Addressing ModeBase Register Points to first address of data (Constant)
Displacement Contains number of bytes above base register where data of interest exists (Variable)
When Base Register is BXPA = DS : BX + Displacement
When Base Register is BPPA = SS : BP + Displacement
These are default segments andSegment-Override Prefix changes them
![Page 18: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/18.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
2577
6500
XX XX
12 10
15F8
00000
03210 8A MOV AL, [BX] + 2F10H
03211 87
03212 10
03213 2F
03214 XX Next Instruction
6500 : 1210 + 2F10 5D
FFFFF
3) Based Addressing Mode
XX 5D
0014P.A’s Mem. contents
![Page 19: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/19.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
2577
6500
XX XX
12 10
15F8
00000
03210 8A MOV AL, [BP] + 2F10H
03211 86
03212 10
03213 2F
03214 XX Next Instruction
2577 : 15F8 + 2F10 5D
FFFFF
3) Based Addressing Mode
XX 5D
0014P.A’s Mem. contents
![Page 20: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/20.jpg)
4) Indexed Addressing ModeDisplacement Points to first address of data (Constant)
Index Register Contains number of bytes above Displacement where data of interest
exists (Variable)
When Index Register is SIPA = DS : SI + Displacement
When Base Register is DIPA = DS : DI + Displacement
These are default segments andSegment-Override Prefix changes them
![Page 21: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/21.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
2577
523C
XX XX
76FF
00000
03210 8A MOV AL, [SI] + 2F10H
03211 84
03212 10
03213 2F
03214 XX Next Instruction
523C : 76FF + 2F10 99
FFFFF
4) Indexed Addressing Mode0014
P.A’s Mem. contents
![Page 22: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/22.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
2577
766A
12 10
8DA5
00000
03210 89 MOV [DI] + 2F10H, BX
03211 9C
03212 10
03213 2F
03214 XX Next Instruction
766A : 8DA5 + 2F10 XX
766A : 8DA5 + 2F10 + 1 XX
FFFFF
4) Indexed Addressing Mode0014
P.A’s Mem. contents
![Page 23: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/23.jpg)
5) Based-Indexed Addressing ModeDisplacement Points to first address of
data (Constant)
Base Register Contains Matrix Column Number (Variable)
Index Register Contains Matrix Row Number (Variable)
Regardless of using SI or DIWhen Base Register is BX PA = DS : BX + (SI or DI) + Displacement
When Base Register is BP PA = SS : BP + (SI or DI) + Displacement These are default segments andSegment-Override Prefix changes them
![Page 24: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/24.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
2577
523C
XX XX
12 34
76FF
00000
03210 8A MOV AL, [BX][SI] + 2F10H
03211 80
03212 10
03213 2F
03214 XX Next Instruction
523C : 1234 + 76FF + 2F10 99
FFFFF
5) Based-Indexed Addressing Mode0014
P.A’s Mem. contents
![Page 25: Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises](https://reader035.vdocument.in/reader035/viewer/2022062407/56649cf95503460f949ca497/html5/thumbnails/25.jpg)
IP
CS
SS
DS
ES
AX
BX
CX
DX
SP
BP
SI
DI
SR
0010
0320
2577
523C
FF 77
12 34
76FF
00000
03210 89 MOV [BP][SI] + 2F10H, AX
03211 82
03212 10
03213 2F
03214 XX Next Instruction
2577 : 1234 + 76FF + 2F10 XX
XX
FFFFF
5) Based-Indexed Addressing Mode0014
P.A’s Mem. contents