: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
MODULE 1
DATA TRANSFER OPERATIONS & FLAG
OPERATIONS
OBJECTIVES
1.
To illustrate
operations.
2.
various
addressing
modes
using
data
transfer
1.
2.
- Contents of X.
X can be memory location or any valid
Register of 8085A.
LSB
- Least Significant Bit.
MSB
- Most Significant Bit.
LSD
- Least Significant Digit (Byte).
MSD
- Most Significant Digit (Byte).
LN
- Lower Nibble.
HN
- Higher Nibble.
B
- Binary.
H
- Hex.
D
- Decimal.
(X)4>(Y
)
- Contents of X is copied to Y.
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
(A) = 23, (B) = 50, (C) = 1A, (D) = 63, (E) = FE, (H) = 76, (L) =
AC
PROCEDURE
1.
Key in the opcodes from the address shown into the trainer.
2.
3.
Single step the program and check the register contents at every
point.
4.
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
PROGRAM
; Load BC with immediate data
LXI B,501A of
; 501A. (B) = 50, (C) = 1A
LDA 4150
; Load A with direct data of FE.
MOV E,A
; (E) = FE
LDA 4151
; Load A with direct data of 63
MOV D,A
; (D) = 63
MVI A,23
; (A) = 23
; Load Immediate data of 76AC
LXI H,76AC to HL
;Pair. (H) = 76, (L) = AC.
HLT
OBJECT CODES
Memory
address
Opcodes
4100
01
4101
1A
4102
50
4103
3A
4104
50
4105
41
4106
Mnemonics
LXI
B, 501A
LDA
4150
5F
MOV
E, A
4107
3A
LDA
4151
4108
51
4109
41
410A
57
MOV
D, A
410B
3E
MVI
A, 23
410C
23
410D
21
410E
AC
410F
76
4110
76
LXI H, 76AC
HLT
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
: (4150) = 29
: (4160) = 29
PROCEDURE
1. Key in the opcodes from the address specified.
2. Enter data at 4150.
3. Execute the program and check for result at 4160.
DISCUSSION
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
PROGRA
M
: 05
LXI
H,4150
LXI
D,4160
MOV
STAX
HLT
A,M
D
OBJECT CODES
Memory
address
Opcodes
4100
21
4101
50
4102
41
4103
11
4104
60
4105
41
4106
Mnemonics
LXI
H,4150
LXI
D,4160
7E
MOV
A, M
4107
12
STAX D
4108
76
HLT
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
:
(4150) = 99
: (4151) = 77 (DE) = 005B
Result
:
(4160) = 5B
(4161) = 00
PROCEDURE
1.
2.
3.
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
PROGRAM
D,
005B
LXI
LHL
D
4150
XCH
G
SHL
D
4160
HLT
OBJECT CODES
Memory address
Opcodes
Mnemonics
4100
11
4101
5B
4102
00
4103
2A
4104
50
4105
41
4106
EB
XCHG
4107
22
SHLD
4108
60
4109
41
410A
76
LXI
D, 005B
LHLD
4150
4160
HLT
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
76
AC
C
1
wher
e,
S
Sign
- Flag:
Zero
- Flag:
AC
Auxiliary carry
- flag:
Parity
- Flag:
Carry
- Flag:
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
In the example given below, you will be testing the status of S, Z, C and P
flags which lead to conditional jumps, calls and returns. This program is a
do nothing program. Each instruction sets and resets flags which can
be monitored separately using the sihgle step command.
PROGRAM:
NOP
MVI
ADI
ANI
ORI
ADI
RAL
XRA
HLT
A,05
FF
F4
14
90
A
OBJECT CODES
Memory
address
Opcodes
Mnemonics
4100
00
NOP
4101
3E
MVI
A, 05
4102
05
4103
C6
ADI
FF
4104
FF
4105
E6
ANI
F4
4106
F4
4107
F6
ORI
14
4108
14
4109
C6
ADI
90
410A
90
410B
17
RAL
410C
AF
XRA
10
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
410D
HLT
PROCEDURE
1.
2.
Only by single-stepping through the program, you can view the Flag
status corresponding to individual instructions.
3.
4.
5.
6.
Now, the NOP would have been executed and the display shows the
address from where the program actually starts. Record this address in
the table.
7.
8.
9.
10.
Note down the value in hex in its equivalent binary form in the table
given below.
11.
12.
13.
Now the next instruction is executed and the flags are updated
accordingly.
14.
Repeat the same from step (vii) and record the values of Flag register
after each operation.
11
Class
: BE (SW) EEE
Name
AngsAnanth
Semester : 05
Roll No.: C5592
15.
Repeat until the address 410D is displayed when STEP key is
pressed.
Mnemoni
Step
c
No.
Flag
Register
Executed
S
1.
2.
3.
4.
5.
6.
7.
8.
9.
Progra
m
AC
- P
- C
Counter
Content
s
NOP
MVI A, 05
ADI FF
ANI F4
ORI 14
ADI 90
RAL
XRA A
HLT
DISCUSSION
12
Class
: BE (SW) EEE
Name
AngsAnanth
Semester
: 05
What are the instructions that always set the Auxiliary Carry Flag
to 1 ?
2.
What does the instruction CMC do? Will Carry Flag be set to 1 or 0
after the execution of the instruction CMC ?
3.
Will the rotate instruction affect both Carry and Auxiliary Carry
Flag ?
4.
5.
6.
7.
Name the instructions that clear the Auxiliary Carry Flag to Zero ?
8.
Assume A to have a data of F5. Now, write the status of flags after
execution of the following instructions one by one and give reasons for
the same.
SUI FB
DAA
XRA A
13