Address
|
Hex Code
|
Label
|
Mnemonics
|
Comments (Purpose)
|
F000
|
3A
|
START:
|
LDA F050
|
Load
the value of Address F050 in accumulator.
|
F001
|
50
|
|||
F002
|
F0
|
|||
F003
|
06
|
|
MVI B,08
|
Set
the accumulator bit counter, counting times of rotation.
|
F004
|
08
|
|||
F005
|
0E
|
|
MVI C,00
|
Set
the counter for the number of 1’s present.
|
F006
|
00
|
|||
F007
|
1F
|
LOOP:
|
RAR
|
Rotate
accumulator right.
|
F008
|
D2
|
|
JNC AHEAD
|
If
carry flag is 0, then go to AHEAD.
|
F009
|
0C
|
|||
F00A
|
F0
|
|||
F00B
|
0C
|
|
INR C
|
Else,
C=C+1.
|
F00C
|
05
|
AHEAD:
|
DCR B
|
B=B-1.
|
F00D
|
C2
|
|
JNZ LOOP
|
If
B is not zero, then go to LOOP.
|
F00E
|
07
|
|||
F00F
|
F0
|
|||
F010
|
79
|
|
MOV A,C
|
Store
contents of register C in accumulator.
|
F011
|
32
|
|
STA F051
|
Store
contents of accumulator at address F051.
|
F012
|
51
|
|||
F013
|
F0
|
|||
F014
|
CF
|
|
RST 1
|
Restart.
|
F015
|
76
|
|
HLT
|
Halt.
|