Monday, April 4, 2011

Program to find maximum number in an array


        LXI H, 2000H ; INITIALIZE STARTING ADDRESS
MVI C, 10H ; SIZE OF ARRAY IS 10
XRA A ;
BACK CMP M ; COMPARE WITH MEMORY
JNC SKIP ;
MOV A, M ; IF NUMBER> MAX INTERCHANGE
SKIP INX H ;
DCR C ;
JNZ BACK ;
STA 1FFFH ;
HLT ;

1 comment: