Documente Academic
Documente Profesional
Documente Cultură
EE2801-L05P01
1.
2.
3.
4.
5.
Return to step 1
Memory
EE2801-L05P02
data to you, but to the processor its all just data. In fact, even addresses are nothing
special - they are just a collection of bits!
Memory
Addresses
a15
Address Bus
CPU
Data Bus
a0
FFFF FFFF
FFFF FFFE
FFFF FFFD
0000
0000
0000
0000
0000
0000
0000
d7
0006
0005
0004
0003
0002
0001
0000
Data
A9
C6
9D
XX
XX
XX
19
FF
3F
2D
34
09
A7
d0
EE2801-L05P03
// Implement equation.
return 0;
EE2801-L05P04
9:
char
00401028 mov
10:
char
0040102C mov
11:
char
12:
13:
C = A +
00401030 movsx
00401034 movsx
00401038 add
0040103A mov
// Implement equation.
eax,byte ptr [ebp-4]
ecx,byte ptr [ebp-8]
eax,ecx
byte ptr [ebp-0Ch],al
In this example, the 004010XX numbers are addresses of instructions, mov is an assembly
language instruction for moving data, epb is a CPU register used as a pointer, eax, ecl, and
al are additional internal processor registers.
Note:
EE2801-L05P05
EE2801-L05P06
A
B
C
.Model
.Stack
small
;64K maximum memory size.
100h ;Reserve 256 bytes for the stack.
.Data
db 7d
db 12d
db ?
.Code
.8086
data space.
for variable A.
for variable B.
for variable B.
start:
nop
;Entry point for program.
;First, the data segments must be initialized so that the data is accessible.
stop:
mov
ax,@data
mov
ds,ax
mov
mov
add
mov
jmp
stop
END start
EE2801-L05P07
Version 4.0
0000
0000
0000
0000
0001
0002
.Model
.Stack
07
0C
??
0003
01/19/00 20:42:02
small
100h
Page 1
stack.
.Data
A db
B db
C db
.Code
.8086
0000
90
start: nop
;Entry point for program.
;First, the data segments must be initialized so that the data is
;accessible.
0001
B8 0000s
mov
ax,@data
0004
8E D8
mov
ds,ax
0006
0009
000D
000F
A0
8A
02
A2
mov
mov
add
mov
0012
EB FE
0000r
1E 0001r
C3
0002r
stop:
;Move the
;into the
;Transfer
;into the
jmp
stop
EE2801-L05P08