Hello ,
I am fresher in assembly language( 80*86) .
Could you please give me any clue , how to write Bubble sort in assembly language.
Any suggestion would be helpful.
I am trying hard but when i run my program it prints all 0's instead of numbers in asscending order.
This sounds a lot like a homework assignment. All you need to do is learn to write assembler code and then code up a bubble sort if you can actually find a use for one.
If your problem is understanding the bubble sort algorithm
then tracing through this unoptimized/simplified pascal example may help.
var
i,j,s,d,t : longword;
A : array[0..7] of longword;
begin
A[0] := 7; A[1] := 6; A[2] := 5; A[3] := 4;
A[4] := 3; A[5] := 2; A[6] := 1; A[7] := 0;
i := 0;
j := 7;
repeat
write(A[i]:2);
i := i + 1;
until i > j;
writeln;
j := 7;
repeat
i := 1;
repeat
s := A[i];
d := A[i-1];
if s < d then begin
t := s; s := d; d := t;
A[i] := s;
A[i-1] := d;
end;
i := i + 1;
until i > j;
j := j - 1;
until j = 0;
i := 0;
j := 7;
repeat
write(A[i]:2);
i := i + 1;
until i > j;
writeln;
end.
Hi to all: My English is poor. But I try.
Mr. eax: You can see here:
http://webster.cs.ucr.edu/
The Art of Assembly Language. Chapter 12.
Thanks.Bye ('_').
thanks for ur help .
I am done with bubble sort in assembly language,
now i need to write a program to test if a string is palindrome or not.
please give me any clue to start with it.
http://www.catb.org/~esr/faqs/smart-questions.html
http://dictionary.reference.com/search?r=2&q=palindrome
Use the search box at the top, search for "String reverse" then "String compare."