2. Flow Chart Start
Initialize HL pair as Pointer
Get value pointed by HL into A
Stop
Increment HL Pointer by 1
Initialize C=N-1 as Counter
X
X
Decrement C by 1
C=0?
Yes
No
Compare A with value shown by HL
Increment HL Pointer by 1
Get value pointed by HL into A
CY=0?
No
Yes
Store A where HL is pointing
3. Address Label Instruction Opcode
6200, 1, 2 LXI H,7200H
3, 4 MVI C,04H
5 MOV A,M
6 INX H
7 CMP M
8, 9, A JNC DOWN
B MOV A,M
C INX H
D DCR C
E, F, 10 JNZ UP
11 MOV A,M
12 RST1
UP:
DOWN:
4. Flow Chart Start
Initialize HL pair as Pointer
Get value pointed by HL into A
Stop
Increment HL Pointer by 1
Initialize C=N-1 as Counter
X
X
Decrement C by 1
C=0?
Yes
No
Compare A with value shown by HL
Increment HL Pointer by 1
Get value pointed by HL into A
CY=1?
No
Yes
Store A where HL is pointing
5. Address Label Instruction Opcode
6200, 1, 2 LXI H,7200H
3, 4 MVI C,04H
5 MOV A,M
6 INX H
7 CMP M
8, 9, A JC DOWN
B MOV A,M
C INX H
D DCR C
E, F, 10 JNZ UP
11 MOV A,M
12 RST1
UP:
DOWN: