Write An Assembly Language Program That Compare Two Arrays Of 10 Elements. Arrays Are Given Below Array1: 10 15 20 25 30 35 40 45 50 55 Array2: 15 10 20 35 40 30 55 50 25 45 You Have To Compare The Array 2 Element One By One With Array1. Onc?

1

1 Answers

Anonymous Profile
Anonymous answered
Org 0x100]
    jmp start

Array1:    Dw 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
Array2:    Dw 15, 10, 20, 35, 40, 30, 55, 50, 25, 45

mov bx, 0;

outer_loop:
  Mov cx,18;

  mov ax, [Array2+bx];
inner_loop:     Cmp ax, [Array1+bx];
  jne Element_is_not_Equal;

Element_is_not_Equal:
  Add bx, 2;
  cmp bx,18;
  jne inner_loop;
sub cx, 2;
cmp cx,0;
jne outer_loop;

mov ax, 0x4c00;
int 0x21

Answer Question

Anonymous