友人の助けを借りて最終的に解決しました。ここにあります :-
KickOff 2050H ;where to start the program
Org 2050H ;where to start the code
lxi sp,23ffH ;initializing stack pointer to 23ffH
lxi hl,0000H ;resulting population to 00 initially for comparison
shld 2501H ;store this poulation (00) to 2501h
lxi hl,2400h ;now load the address of start loc of data
mvi c,06h ;counter for 6 countries
loop:
mov d,m ;store the index of current country in d register
inx hl ;increase hl pair
mov b,m ;store the first byte of current population in b
inx hl
mov e,m ;store the second byte of current population in e
push hl ;push hl pair onto stack for later use
lxi hl,2501h
mov a,b
cmp m ;compare first byte (a-m) will set c=1 if m>a
jc next ;if carry do nothing
jz next1 ;if z=1, they are equal so we compare next two bytes
mov m,a ;if current greater than previous value then change values of 2501 and 2502 and also index
inx hl
mov m,e
mov a,d
sta 2500h ;ab kitna samjaye, kr lo khud se
jmp next
next1:
inx hl
mov a,e
cmp m
jc next
mov m,e
dcx hl
mov m,b
mov a,d
sta 2500h
next:
pop hl
inx hl
dcr c
jnz loop
hlt
皆様、ご回答ありがとうございます!! :)