Escolar Documentos
Profissional Documentos
Cultura Documentos
D A T
:
AIM:
8086 PROGRAMMING
ADDITION & SUBTRACTION
To write an Assembly Language Program (ALP) for performing the Addition and
subtraction operation of 16-bit numbers.
APPARATUS REQUIRED:
SL.N
ITEM
O
1. Microprocessor kit
2. Power Supply
SPECIFICATION
8086 kit
+5 V dc
QUANTITY
1
1
ALGORITHM:
16-bit addition
i.
Initialize the MSBs of sum to 0
ii) Get the first number.
iii) Add the second number to the first number.
iv) If there is any carry, increment MSBs of sum by 1.
v.
Store LSBs of sum.
vi) Store MSBs of sum.
16-bit subtraction
Initialize the MSBs of difference to 0
ii) Get the first number
iii) Subtract the second number from the first number.
iv) If there is any borrow, increment MSBs of difference by 1.
v.
Store LSBs of difference
vi) Store MSBs of difference.
i.
FLOWCHART:
ADDITION
PROGRAM
COMMENTS
Initialize counter CX
MOV AX,[1200]
ADD AX,BX
JNC L1
INC CX
L1 : MOV [1206],CX
MOV [1204], AX
HLT
SUBTRACTION
PROGRAM
COMMENTS
Initialize counter CX
MOV AX,[1200]
SUB AX,BX
JNC L1
INC CX
L1 : MOV [1206],CX
MOV [1204], AX
HLT
3
3
OUTPUT:
ADDITION
MEMORY
DATA
SUBTRACTION
MEMORY
DATA
RESULT:
Thus addition & subtraction of two byte numbers are performed and the result is
stored.
EXPT NO: 2
DATE:
AIM:
QUANTITY
1
1
FLOWCHART:
MULTIPLICATION
PROGRAM
MOV AX,[1200]
MOV BX, [1202]
COMMENTS
Get the first data
Get the second data
MUL BX
Multiply both
MOV [1206],AX
MOV AX,DX
MOV [1208],AX
HLT
DIVISION
PROGRAM
MOV AX,[1200]
MOV DX, [1202]
COMMENTS
Get the first data lower nibble
Get the first data higher nibble
DIV BX
MOV [1206],AX
MOV AX,DX
MOV [1208],AX
HLT
7
7
OUTPUT:
MULTIPLICATION
MEMORY
DATA
DIVISON
MEMORY
DATA
RESULT:
Thus multiplication & division of two byte numbers are performed and the result is
stored.
8
EXPT NO: 3
DATE:
AIM:
SPECIFICATION
QUANTITY
8086
+5 V dc
1
1
ALGORITHM:
Sorting in ascending order:
01 and C 2.
i. Load the array count in two registers C ii) Get the first two numbers.
iii) Compare the numbers and exchange if necessary so that the two numbers are
in ascending order.
iv) Decrement C
2.
v. Get the third number from the array and repeat the process until C 2 is 0.
vi) Decrement C1 and repeat the process until C 1 is 0.
Sorting in descending order:
01 and C 2.
i. Load the array count in two registers C ii) Get the first two numbers.
iii) Compare the numbers and exchange if necessary so that the two numbers are
in descending order.
iv) Decrement C2.
v. Get the third number from the array and repeat the process until C 2 is 0.
01 and repeat the process until C 1 is 0.
vi) Decrement C
9
FLOWCHART
10
ASCENDING
MOV SI,1200H
MOV CL,[SI]
L4 : MOV SI,1200H
MOV DL,[SI]
INC SI
MOV AL,[SI]
L3 : INC SI
MOV BL,[SI]
CMP AL,BL
JNB L1
DEC SI
MOV [SI],AL
MOV AL,BL
JMP L2
L1 : DEC SI
MOV [SI],BL
L2 : INC SI
DEC DL
JNZ L3
MOV [SI],AL
DEC CL
JNZ L4
HLT
DESCENDING
PROGRAM
MOV SI,1200H
MOV CL,[SI]
L4 : MOV SI,1200H
MOV DL,[SI]
INC SI
MOV AL,[SI]
L3 : INC SI
MOV BL,[SI]
CMP AL,BL
JB L1
DEC SI
If AL > BL go to L1
Else, Decrement the memory location
MOV [SI],AL
MOV AL,BL
JMP L2
L1 : DEC SI
MOV [SI],BL
L2 : INC SI
DEC DL
JNZ L3
MOV [SI],AL
DEC CL
JNZ L4
HLT
MEMORY
DATA
DESCENDING
MEMORY
DATA
RESULT:
Thus given array of numbers are sorted in ascending & descending order
12
EX NO:4
AIM:
SPECIFICATION
8086
+5 V dc
QUANTITY
1
1
ALGORITHM:
(i) Finding largest number:
a. Load the array count in a register C
c. Compare the numbers and exchange if the number is small.
d. Get the third number from the array and repeat the process until C
(ii) Finding smallest number:
e. Load the array count in a register C1.
f. Get the first two numbers.
h. Get the third number from the array and repeat the process until C1 is 0.
13
b
g. C
om
par
e
the
FLOWCHART:
14
LARGEST
PROGRAM
MOV SI,1200H
MOV CL,[SI]
INC SI
MOV AL,[SI]
DEC CL
L2 : INC SI
CMP AL,[SI]
JNB L1
MOV AL,[SI]
L1 : DEC CL
JNZ L2
MOV DI,1300H
MOV [DI],AL
HLT
SMALLEST
PROGRAM
COMMENTS
Initialize array size
Initialize the count
Go to next memory location
Move the first data in AL
Reduce the count
Move the SI pointer to next data
Compare two datas
If AL > [SI] then go to L1 ( no swap)
Else move the large number to AL
Decrement the count
If count is not zero go to L2
Initialize DI with 1300H
Else store the biggest number in 1300 location
Stop
COMMENTS
MOV SI,1200H
MOV CL,[SI]
INC SI
MOV AL,[SI]
DEC CL
L2 : INC SI
CMP AL,[SI]
JB L1
MOV AL,[SI]
L1 : DEC CL
JNZ L2
MOV DI,1300H
MOV [DI],AL
HLT
15
1
LARGEST
MEMORY
DATA
SMALLEST
MEMORY
DATA
RESULT:
Thus largest and smallest number is found in a given array.
16
8086 PROGRAMMING
APPARATUS REQUIRED:
SL.N
ITEM
O
1.
Microprocessor kit
2.
Power Supply
SPECIFICATION
8086
+5 V dc
ALGORITHM:
17
QUANTITY
1
1
FLOWCHART:
18
COPYING A STRING
PROGRAM
MOV SI,1200H
MOV DI,1300H
MOV CX,0006H
CLD
REP MOVSB
HLT
COMMENTS
INPUT
MEMORY
DATA
OU
TP
UT
MEMORY
DATA
RESULT:
EXPT NO: 6
SEARCHING A STRING
DATE:
AIM:
To scan for a given byte in the string and find the relative address of the byte
from the starting location of the string.
ALGORITHM:
19
20
FLOWCHART
21
MOV DI,1300H
CLD
REPNE SCASB
DEC DI
MOV BL,[DI]
MOV [SI],BL
HLT
Stop
OUTPUT:
INPUT
MEMORY
OUT
PUT
DATA
MEMORY LOCATION
DATA
RESULT:
Thus a given byte or word in a string of a particular length in the extra
segment(destination) is found .
EXNO: 7
22
8086 PROGRAMMING FIND AND REPLACE
DATE:
AIM:
register.
d. Move the byte to be searched in the AL register.
e. Store the ASCII code of the character that has to replace the scanned
byte in BL register.
f. Scan for the byte in ES. If the byte is not found, ZF?1 and repeat
scanning.
g. If the byte is found, ZF=1.Move the content of BL register to
ES:DI.
21
23
FLOWCHART:
24
COMMENTS
Initialize destination address
Initialize starting address
Initialize array size
CLD
MOV BH,30H
REPNE SCASB
DEC DI
MOV BL,[DI]
MOV [SI],BL
MOV [DI],BH
HLT
Stop
INPUT
MEMORY
DATA
DATA
OU
TP
UT
RESULT:
MEMORY
25
8086 INTERFACING
INTERFACING ANALOG TO DIGITAL CONVERTER
1.
2.
3.
ITEM SPECIFICATION
Microprocessor kit
Power Supply
ADC Interface board
QUANTITY
8086
+5 V dc,+12 V dc
-
1
1
1
THEORY:
An ADC usually has two additional control lines: the SOC input to tell the
ADC when to start the conversion and the EOC output to announce when the
conversion is complete. The following program initiates the conversion
process, checks the EOC pin of ADC 0809 as to whether the conversion is over
and then inputs the data to the processor. It also instructs the processor to store
the converted digital data at RAM location.
ALGORITHM:
(i)
26
FLOW CHART:
27
PROGRAM TABLE
PROGRAM
COMMENTS
MOV AL,00
OUT 0D0H,AL
Send
through
output p
MOV AL,00
MOV AL,00
Introduce delay
MOV AL,00
MOV AL,00
OUT 0D0H,AL
L1 : IN AL, 0D8H
AND AL,01
Read the EOC signal from port & check for end of
conversion
CMP AL,01
JNZ L1
from por
IN AL,0C0H
ANALOG
VOLTAGE
RESULT:
Thus the ADC was interfaced with 8086 and the given analog inputs were
converted into its digital equivalent.
EXNO: 9
DATE:
AIM:
28
8086 INTERFACING
INTERFACING DIGITAL TO ANALOG CONVERTER
APPARATUS REQUIRED:
SL.NO
1.
2.
ITEM SPECIFICATION
Microprocessor kit
Power Supply
3.
DAC Interface board
QUANTITY
8086 Vi Microsystems
+5 V, dc,+12 V dc
-
1
1
1
THEORY:
Since DAC 0800 is an 8 bit DAC and the output voltage variation is between 5v
and +5v. The output voltage varies in steps of 10/256 = 0.04
(approximately). The digital data input and the corresponding output voltages are
presented in the table. Outputting digital data 00 and FF at regular intervals, to
DAC2, results in a square wave of amplitude 5v.Output digital data from 00 to FF
in constant steps of 01 to DAC2. Repeat this sequence again and again. As a
result a saw-tooth wave will be generated at DAC2 output. Output digital
data from 00 to FF in constant steps of 01 to DAC2. Output digital data from FF to
00 in constant steps of 01 to DAC2. Repeat this sequence again and again. As a
result a triangular wave will be generated at DAC2 output.
ALGORITHM:
29
Saw-tooth waveform:
(i)
Load low value (00) to accumulator.
(ii)
Send this value to DAC.
(iii) Increment the accumulator.
(iv)
Repeat step (ii) and (iii) until accumulator value reaches FF.
(vi)
Repeat the above procedure from step 1.
Triangular waveform:
(i)
Load the low value (00) in accumulator.
(ii)
Send this accumulator content to DAC.
(iii)
Increment the accumulator.
(iv) Repeat step 2 and 3 until the accumulator reaches FF, decrement the
accumulator and send the accumulator contents to DAC.
(v) Decrementing and sending the accumulator contents to DAC.
(vi) The above procedure is repeated from step (i)
30
FLOWCHART:
31
PROGRAM
COMMENTS
Load digital value 00 in accumulator
Send through output port
Stop
MOV AL,7FH
OUT C0,AL
HLT
DIGITAL DATA
ANALOG VOLTAGE
COMMENTS
COMMENTS
Load 00 in accumulator
Send through output port
Increment contents of accumulator
Send through output port until it reaches FF
Go to starting location
27
32
COMMENTS
Load 00 in accumulator
Send through output port
Increment contents of accumulator
Send through output port until it reaches FF
Load FF in accumulator
Send through output port
Decrement contents of accumulator
Send through output port until it reaches 00
Go to starting location
WAVEFORM GENERATION:
WAVEFORMS
AMPLITUDE
Square Waveform
Saw-tooth waveform
Triangular waveform
MODEL GRAPH:
Square Waveform
33
TIMEPERIOD
Saw-tooth waveform
Triangular waveform
RESULT:
Thus the DAC was interfaced with 8085 and different waveforms have been
generated.
EXNO: 10
DATE:
34
STEPPER MOTOR INTERFACING
AIM:
ITEM SPECIFICATION
QUANTITY
Microprocessor kit80861
Power Supply+5 V, dc,+12 V dc
1
Stepper Motor Interface board- 1
Stepper Motor
THEORY:
1.
2.
3.
4.
A motor in which the rotor is able to assume only discrete stationary angular
position is a stepper motor. The rotary motion occurs in a stepwise manner
from one equilibrium position to the next. Two-phase scheme: Any two
adjacent stator windings are energized. There are two magnetic fields active in
quadrature and none of the rotor pole faces can be in direct alignment with the
stator poles. A partial but symmetric alignment of the rotor poles is of course
possible.
ALGORITHM:
B2
CODE
0
1
0
0
HEX
09 H
05 H
06 H
0A H
35
FLOWCHART:
36
PROGRAM TABLE
PROGRAM
COMMENTS
Introduce delay
Go to next memory location
LOOP LOOP1
JMP START
1200 : 09,05,06,0A
RESULT:
Thus the assembly language program for rotating stepper motor in both clockwise and
anticlockwise directions is written and verified.
EXNO: 11
DATE:
AIM:
37
INTERFACING PROGRAMMABLE KEYBOARD AND
DISPLAY CONTROLLER- 8279
APPARATUS REQUIRED:
DD
00
0
00
0
01
D
38
00
D
00
K
00
K
0
K
1
CD
1
CD
1
CD
0
CA
CF
A0-3; B0-3 =FF
11
1-Enables Clear display
0-Contents of RAM will be displayed
39
3.
1
1
AI
0 0
32
40
PROGRAM TABLE:
PROGRAM
START : MOV SI,1200H
MOV CX,000FH
MOV AL,10
OUT C2,AL
MOV AL,CC
OUT C2,AL
MOV AL,90
OUT C2,AL
L1 : MOV AL,[SI]
OUT C0,AL
CALL DELAY
INC SI
LOOP L1
JMP START
DELAY : MOV DX,0A0FFH
LOOP1 : DEC DX
JNZ LOOP1
RET
COMMENTS
Initialize array
Initialize array size
Store the control word for display mode
Send through output port
Store the control word to clear display
Send through output port
Store the control word to write display
Send through output port
Get the first data
Send through output port
Give delay
Go & get next data
Loop until all the datas have been taken
Go to starting location
Store 16bit count value
Decrement count value
Loop until count values becomes zero
Return to main program
LOOK-UP TABLE:
1200
98
68
7C
29
FF
C8
1204
FF
1C
41
OUTPUT:
E
7-SEGMENT
LED FORMAT
H
E
X
D
A
T
A
01
00
10
01
11
00
10
01
1200H
1201H
1202H
1203H
1204H
1205H
1206H
1207H
RESULT:
0
1
1
1
1
0
0
1
0
1
1
0
1
0
1
1
1
0
1
0
1
0
0
1
1
1
1
1
1
1
1
1
0
0
1
0
1
1
0
1
0
0
0
0
1
0
0
1
0
0
0
0
1
0
1
1
98
68
7C
C8
FF
1C
29
FF
Thus the rolling message HELP US is displayed using 8279 interface kit.
42
INTERFACING PROGRAMMABLE TIMER-8253
EXNO: 12
DATE:
A IM:
It is a simple divide - by N counter. The output will be low for one input
clock period. The period from one output pulse to the next equals the number
of input counts in the count register. If the count register is reloaded between
output pulses, the present period will not be affected, but the subsequent
period will reflect the new value.
MODE 3 SQUARE WAVE GENERATOR
It is similar to mode 2, except that the output will remain high until one half
for even number count, If the count is odd, the output will be high for
(count+1)/2 counts and low for (count-1)/2 counts
ALGORITHM:
Mode 21.
2.
3.
4.
5.
43
34
Mode 3-
1.
2.
3.
4.
5.
PORT ADDRESS:
1.
CONTROL REGISTER
2. COUNTER OF CHANNEL 0
3. COUNTER OF CHANNEL 1
4. COUNTER OF CHANNEL 2
5. O/P PORT OF CHANNEL 0
6. O/P PORT OF CHANNEL 1
7. O/P PORT OF CHANNEL 2
M2
M1
M0
BCD
00 1
Mode 2 = 34 H
00
01
SC1
SC0
CHANNEL SELECT
0
0
CHANNEL 0
0
1
CHANNEL 1
1
0
CHANNEL 2
1
1
----BCD --0 BINARY COUNTER
M2
M1
M0
MODE
Mode 3 = 36 H
0
0
1
1
RL1
0
1
0
1
RL0
READ/LOAD
LATCH
LSB
MSB
LSB FIRST, MSB NEXT
01 --BCD COUNTER
0
0
0
0
1
1
0
0
1
0
1
0
1
0
1
MODE 0
MODE 1
MODE 2
MODE 3
MODE 4
MODE 5
1 CLK 0
2 CLK 1
3 CLK 2
44
FLOW CHART:
45
04 OUT 0
05 OUT 1
06 OUT 2
07 GATE 0
08 GATE 1
09 GATE 2
10 GND
COMMENTS
Store the control word in accumulator
Send through output port
Copy lower order count value in accumulator
Send through output port
Copy higher order count value in accumulator
Send through output port
Stop
COMMENTS
Store the control word in accumulator
Send through output port
Copy lower order count value in accumulator
Send through output port
Copy higher order count value in accumulator
Send through output port
Stop
6
46
MODEL GRAPH:
RATE GENERATOR
RESULT:
Thus an ALP for rate generator and square wave generator are written and
executed.
47
EXNO: 13
DATE:
AIM:
1...transmit enable
1...data terminal ready 1... receive enable
1... send break character
1.... reset error flags (pe,oe,fe)
1..... request to send (rts)
1...... internal reset
1....... enter hunt mode (enable search for sync characters)
48
01 ransmitter ready
receiver ready 1.. transmitter
empty 1... parity error (pe)
1.... overrun error (oe)
1..... framing error (fe), async only
1.
ALGORITHM:
1. Initialize 8253 and 8251 to check the transmission and reception of a character
2.
Initialize8253 to give an output of 150Khz at channel 0 which will give a
operation, or when the host CPU is checking the status of the device before
starting the next I/O operation.
FLOW CHART:
50
Thus ALP for serial data communication using USART 8251 is written and the
equivalent ASCII 41 for character A is been transmitted & received.
51
INTERFACING PPI 8255
EXNO: 14
DATE:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
Mode 0
1.
2.
3.
4.
5.
1.
2.
3.
4.
5.
6.
7.
8.
52
FLOWCHART:
53
MODE 0
PROGRAM
MOV AL,90H
OUT C6,AL
IN AL,C0
OUT C2,AL
HLT
COMMENTS
Set the control word
Send it to control port
Get the contents of port A in AL
Send the contents of port B to port address
Stop
MODE 1
PROGRAM
MOV AL,0B0H
OUT C6,AL
MOV AL,09H
OUT C6,AL
MOV AL,13H
OUT 30,AL
MOV AL,0AH
OUT 32,AL
MOV AL,0FH
OUT 32,AL
MOV AL,00H
OUT 32,AL
STI
HLT
ISR:
IN AL,C0
OUT C2,AL
HLT
MODE 2
PROGRAM
MOV AL,0C0H
OUT C6,AL
MOV AL,09H
OUT C6,AL
MOV AL,13H
OUT 30,AL
MOV AL,0AH
OUT 32,AL
COMMENTS
Set the control word for mode 1
Send it to control port
Control for BSR mode
Send it to control port
Interrupt generation
Through 8259
Using IR2 interrupt(lower order count)
Higher order count
Set trap flag
Stop
Subroutine
Read from Port A
Send it to Port B
Stop
COMMENTS
Set the control word for mode 2
Send it to control port
Control for BSR mode
Send it to control port
Interrupt generation
Through 8259
54
MOV AL,0FH
OUT 32,AL
MOV AL,00H
OUT 32,AL
STI
HLT
ISR:
IN AL,C0
OUT C2,AL
HLT
BSR mode
Bit set/reset, applicable to PC only. One bit is S/R at a time. Control word:
D7
D5
D4
D3
(0=BSR)
X
Bit select: (Taking Don't care's as 0)
D6
B2
B2
00
B1
00
10
00
00
01
01
11
01
D2
B1
D1
B0
D0
S/R (1=S,0=R)
B0
PC bit
I/O mode
D7
01
D6
(1=I/O)
D5
D4
GA mode select
D3
PA
D2
PCU
GB mode
D1
D0
PB
PCL
select
Result:
Input
Mode 0
Mode 1
Mode 2
Output Input Output Input Output
The programs for interfacing 8255 with 8085 are executed & the output is
obtained for modes 0,1 & 2.
55
8051 PROGRAMMING
8 BIT ADDITION
EXNO: 15
DATE:
AIM
:
ALGORITHM:
1.
2.
3.
5.
6.
7.
56
FLOW CHART:
57
C
O
M
M
E
N
T
S
4100
4101
CLR
MOV
C3
74,data1
A,# data1
4103
ADDC
A.
4105
# data 2
MOV
DPTR, #
4500H
24,data2
with
data2
90,45,00
memory
Initialize the
location
Store the result in
4108
4109
Clear CY Flag
Get the data1 in
Accumulator
Add the data1
L1
MOVX
SJMP
0@ DPTR, A F0
L1
80,FE
memory location
Stop the program
OUTPUT:
OUTPUT
MEMORY LOCATION
DATA
4500
RESULT:
Thus the 8051 ALP for addition of two 8 bit numbers is executed.
EXNO: 16
58
8051 PROGRAMMING 8 BIT SUBTRACTION
DATE:
AIM:
To perform subtraction of two 8 bit data and store the result in memory.
ALGORITHM:
a.
b.
c.
d.
e.
f.
59
FLOWCHART:
-
60
LABEL
MNEMONIC
COMMENTS
C3
Clear CY flag
CLR
A.
4101
MOV
4103
SUBB
data1
A.
4105
MOV
4108
MOVX
#
#
data2
DPTR, # 4500
memory
74.
Initialize F0
in memo
location
Store the difference
0@ DPTR, A
4109
L1
SJMP
L1
80,FE
OUTPUT:
OUTPUT
RESULT:
Thus the 8051 ALP for subtraction of two 8 bit numbers is executed
61
data1
Stop
EXNO: 17
AIM:
To perform division of two 8 bit data and store the result in memory.
ALGORITHM:
a.
b.
c.
d.
62
FLOWCHART:
63
08 Bit Multiplication
ADDRESS
OPERAND
4100
LABEL
MOV
A ,#data1
75,data2
MUL
MOV
4109
MOVX
INC
401A
410B
410D
410E
STOP
MNEMONIC
F5,F0
90,45,00
F0
DPTR
result
A3
MOV
A,B
MOV
0@ DPTR, A
SJMP
74.
COMMENTS
Go to next memory
location
E5,F0
STOP
80,FE
Stop
OUTPUT:
INPUT
MEMORY LOCATION
4500
OUTPUT
DATA
MEMORY LOCATION
DATA
4502
RESULT:
Thus the 8051 ALP for multiplication of two 8 bit numbers is executed
EXNO: 18
64
8051 PROGRAMMING 8 BIT DIVISION
DATE:
AIM:
To perform division of two 8 bit data and store the result in memory.
ALGORITHM:
Store hig
order
result
F
0
1.
2.
3.
4.
65
FLOWCHART:
66
08 Bit Division
ADDRESS
OPERAND
4100
4102
4104
4015
LABEL
MOV
MOV B, # data2
4018
75,data2
DIV
MOV
MOVX
4109
410A
410C
410D
INC
MOV
MOV
HEX
CODE
74,data1
data1 in
MNEMONIC
A.
# data1
A3
A,B
E5,F0
0@ DPTR, A
F0
STOP
80,FE
COMMENTS
Store
84
90,45,00
next memory
location
Store quotient
STOP SJMP
OUTPUT:
4501 (divisor)
4503
DATA
(remainder)
(quotient)
RESULT:
Thus the 8051 ALP for division of two 8 bit numbers is executed
EXNO: 19
Divide
location
Store remainder Go to
Stop
INPUT OUTPUT
MEMORY LOCATION DATA MEMORY LOCATION
4502
4500 (dividend)
accumul
r
67
8051 PROGRAMMING
LOGICAL AND BIT MANIPULATION
DATE:
AIM:
To write an ALP to perform logical and bit manipulation operations using 8051
microcontroller.
APPARATUS REQUIRED:
1.
2.
3.
4.
5.
6.
7.
8.
68
FLOWCHART:
69
PROGRAM TABLE:
A
LABEL
MNEMONICS
COMMENT
OPERAND
4100
0
9
0,
4
5,
0
MOV
Initialize m
e
m
o
r
y
DPTR,#4500
location
Get the data in
4103
74,
FF
4105
D3
4016
82,EF
MOV
SETB
ANL
A,#FF
C
accumulator
Set CY bit
AC
C.
C.7
MOVX
INC
@DPTR,A
DPTR
ORL
C.
410B
A3
410C
72,AA
410E
4110
E.2
4113
4114
D2,90
SETB
4116
C2,99
CLR
MOV
@DPTR,A
DPTR
SCON.5
SCON.1
Go to next location
OR CY bit with 2nd bit
if IE reg
A,DOH
Go to next location
Set 5th of SCON reg
Clear 1st bit of SCON
reg
F0
A3
MOVX @DPTR,A
DPTR
70
411C
A2,99
MOV
411E
E5,D0
MOV
A,DOH
F0
MOVX
@DPTR,A
SJMP
L2
4120
4122
80,FE
L2
C,SCON.1
G
o
to
ne
xt
lo
ca
ti
on
C
o
py 1st bit of
SCON
reg
to
C
Y
flag
Stop
OUTPUT:
MEMORY
LOCATION
BEFORE
EXECUTION
AFTER
EXECUTION
4500H (PSW)
OV
-
CY
00H
AC
FO
RS1
RS0
88H
4501H (PSW)
OV
-
CY
40H
AC
FO
RS1
RS0
88H
4502H (SCON)
RI
4503H (PSW)
OV
-
SM0
SM1
SM2
REN
TB8
RB8
TI
20H
0FH
P
CY
FFH
AC
FO
RS1
RS0
RESULT:
71
09H
72